Bug 2069538

Summary: python-inspyred fails to build with Python 3.11: IndexError: list index out of range
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-inspyredAssignee: Shane Allcroft <shane>
Status: CLOSED RAWHIDE QA Contact: Shane Allcroft <shane>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mhroncok, neuro-sig, sanjay.ankur, shane, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-22 11:49:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2022-03-29 06:30:37 UTC
python-inspyred fails to build with Python 3.11.0a6.

======================================================================
ERROR: test (tests.example_tests.PAES_Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/tests/example_tests.py", line 77, in test
    paes = examples.standard.paes_example.main(prng=prng)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/examples/standard/paes_example.py", line 13, in main
    final_pop = ea.evolve(generator=problem.generator,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/inspyred/ec/emo.py", line 171, in evolve
    final_pop = ec.EvolutionaryComputation.evolve(self, generator, evaluator, pop_size, seeds, maximize, bounder, **args)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/inspyred/ec/ec.py", line 454, in evolve
    self.archive = self.archiver(random=self._random, population=list(self.population), archive=list(self.archive), args=self._kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/inspyred/ec/archivers.py", line 201, in adaptive_grid_archiver
    update_grid(ind, new_archive, num_grid_divisions, adaptive_grid_archiver.global_smallest,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/inspyred-5fa8224f0c81c74e3c6183457f760af854ad72fb/inspyred/ec/archivers.py", line 187, in update_grid
    grid_population[loc] += 1
    ~~~~~~~~~~~~~~~^^^^^
IndexError: list index out of range

----------------------------------------------------------------------
Ran 63 tests in 19.702s

FAILED (errors=1, skipped=2)
Test failed: <unittest.runner.TextTestResult run=63 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=63 errors=1 failures=0>

https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03845200-python-inspyred/

For all our attempts to build python-inspyred with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-inspyred/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ankur Sinha (FranciscoD) 2022-04-11 14:10:00 UTC
Thanks for taking this one up, Shane. This will probably require some patching---I had sent upstream patches to fix inspyred for py3 initially, so we probably need a few more tweaks for 3.11:

https://github.com/aarongarrett/inspyred/pull/21

Do try scratch builds for rawhide first, though---sometimes things just magically fix themselves XD

Comment 2 Miro Hrončok 2022-06-22 11:49:14 UTC
Closing this in bulk as it built with Python 3.11. If this needs to remain open for a followup, feel free to reopen, I won't close in bulk again.