-
Notifications
You must be signed in to change notification settings - Fork 32
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
Use python 3.9 #197
Merged
Merged
Use python 3.9 #197
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the result of `2to3 --write --nobackups fiaas_deploy_daemon/ setup.py tests/ bin/`
tox and k8s wants six > 1.12.
Flask should be upgraded to 2.x. For the purposes of switching to python3, keep it at 1.x to minimize amount of changes at the same time.
Remove logic to set traceback and message explicitly in UpsertConflict, rely on raise from. Also add a test for UpsertConflict.__str__
How did this work before?
python3 dicts are ordered so some tests relying on this fails
The hash builtin function is used to create name suffixes for ApplicationStatus resources. In Python 3 this function has changed to a different algorithm which also uses a random seed set at interpreter start. Use py27hash to "forward-port" the Python 2 hash function so that Python 3 based fiaas-deploy-daemon can look up ApplicationStatus resources created by Python 2 based fiaas-deploy-daemon and the other way around
Recent versions of pip won't build wheels properly for releases that don't have PEP440 compliant versions. Switch the development release tag from `-SNAPSHOT` to `.dev`, which is the PEP440 compliant way of tagging a development release[1]. [1]: https://peps.python.org/pep-0440/#developmental-releases
AssertionError (and other exceptions) no longer have the message attribute. Use exception chaining to add the additional information
The order these appear in has changed because of changes in dict ordering in python2 -> python3. It has no effect on the resulting deployment, so just update the expected result for the tests
subprocess output is bytes. decode to string so it renders better in error messages.
When using `sem-version python`, `python` is provided via a virtualenv. Because of this `--user` install isn't necessary (and does not work), so do a regular `pip install` into the virtualenv for CI dependencies.
Mostly whitespace as well as a few unused imports after making code py3 compatible
henrik242
approved these changes
Dec 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Awesome work @oyvindio ! I’ll have a look through. |
birgirst
approved these changes
Dec 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switch from python 2.7 to 3.9.
I picked python 3.9 to get up to python 3.x with the least amount of changes, as using 3.10 or 3.11 will require updating some dependencies since 3.10 removes a few things that have been deprecated for some time.
Summary of changes:
2to3
. This is mostly removal of unicode literals and__future__
imports, wrapping calls to APIs which have changed to return a different iterable type inlist()
and a few other changes.hash()
with py27hash for generating ApplicationStatus names to ensure the same names as python2 fiaas-deploy-daemon would generate.unittest.mock
andtime.monotonic
from stdlib, drop 3rd party dependencies.closes #6