Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2to3 #625

Merged
merged 11 commits into from
Aug 7, 2022
Merged

2to3 #625

merged 11 commits into from
Aug 7, 2022

Conversation

keszybz
Copy link
Contributor

@keszybz keszybz commented Feb 27, 2022

Python3.11 dropped support for 2to3, so its use in setup.py creates problems during installation.
This patchset rewrites the code (using 2to3 as the base) to python3 and does some minor
cleanups on the way.

All warnings are eliminated.

Previously those would be ignored, but now they generate a warning:
...
deap/cma.py:279
  /home/zbyszek/python/deap/deap/cma.py:279: DeprecationWarning: invalid escape sequence '\l'
    """Generate a population of :math:`\lambda` individuals of type
...

Not duplicating backslashes makes writing tex much nicer, so let's use r''.
/home/zbyszek/python/deap/deap/tools/emo.py:629: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  available = numpy.ones(len(individuals), dtype=numpy.bool)
python2 is dead, and python3.11 dropped support for 2to3, so its use in setup.py
creates problems during installation. Let's just rewrite the code (using 2to3)
to python3.
@stonebig
Copy link

it would be nice to have this in a release

@stonebig
Copy link

stonebig commented May 3, 2022

And it seems to work well

@stonebig
Copy link

stonebig commented May 7, 2022

Is DEAP project alive ?

@imatheussm
Copy link

Just installed this and it solved the problems I was experiencing. Hope this gets merged soon. Kudos for the splendid work!

@anilbey
Copy link

anilbey commented Jun 10, 2022

@Julian @fmder @cmd-ntrf perhaps it's time to merge this.

@aabmets
Copy link

aabmets commented Jun 12, 2022

@anilbey @stonebig @keszybz
waiting-for-reply-from-maintainers

@fmder
Copy link
Member

fmder commented Aug 7, 2022

Reviving this, 22/29 completed.

@fmder fmder merged commit 18d2b55 into DEAP:master Aug 7, 2022
@keszybz keszybz deleted the 2to3 branch August 7, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants