-
Notifications
You must be signed in to change notification settings - Fork 2
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
Enforce that all scripts use Python 3 rather than Python 2 #43
Conversation
7f95b78
to
0e0aaed
Compare
FYI, the main branch of this project is now failing APB builds. |
This code appears to work with either Python 2 or Python 3, so it makes sense to insist on Python 3 now that Python 2 is EOL.
0e0aaed
to
14cbeb9
Compare
Realign setup.py with the version used in cisagov/skeleton-python-library now that we no longer need to support Python 2.
We no longer need to adjust the import depending on which major Python version is being used.
Until this project is converted into a proper Python package this is how it needs to be updated to reflect the package version.
Make sure the `build.yml` workflow in this project mirrors the one in cisagov/skeleton-python-library now that we no longer need to support Python 2.
@mcdonnnj, could you leave a comment here explaining why this PR cannot yet be merged? |
@jsf9k Until we're deploying Debian Buster/Bullseye instances we have to consider Debian Stretch which only has Python 3.5. The lowest version of Python 3 this supports is 3.6 per Line 83 in d02e28e
|
Now that Debian Stretch is dead as Dillinger, does this change anything? |
No. If there is a critical problem with the Buster images I can always create a cursed Ansible role to pull from the Debian archive for package updates to fall back on Stretch. I would rather minimize any peripheral impact until I get new images built, deployed, and verified.
|
Pull in the current pre-commit configuration from cisagov/skeleton-python-library and update the mypy hook dependencies. This is necessary to restore a functional pre-commit configuration to the project.
This only resulted in the `black` hook adjusting a single file.
In Python 3 files are by default opened in text-mode, which suites the JSON we are outputting, and file seeking behavior is different. This change is necessary to get compatible behavior now that this project only supports Python 3.
As currently written the following warning is emitted when using the scripts: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead. Since this project will only support Python 3.6+ going forward it makes sense to update to remove this warning.
Pull in the current version in cisagov/skeleton-python-library as that is the most comparable to the current workflow definition. This is necessary to fix testing Python 3.6.
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.
I can only comment on this PR, but if I could I would request a few minor changes.
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.
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
Update the package's classifiers to align with both the testing being done and the current defaults in cisagov/skeleton-python-library.
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.
I can only comment on this PR, but I would approve it with gusto if I could!
π₯³ |
π£ Description
This pull request makes a change to enforce that all the scripts contained in this repo use Python 3 vice Python 2.
π Motivation and context
The one remaining script that used Python 2 code appears to work with either Python 2 or Python 3, so it makes sense to insist on Python 3 now that Python 2 is EOL.
π§ͺ Testing
All automated tests pass.
@mcdonnnj, is this one line change something that can be manually done in production to verify that it functions as expected?
β Pre-approval checklist
β Pre-merge checklist
β Post-merge checklist