-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Add eol python warnings #1822
base: main
Are you sure you want to change the base?
Add eol python warnings #1822
Conversation
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.
Thanks for the PR! I've dropped a couple of minor suggestions inline (mostly comments so that it's obvious to future code explorers what is going on).
You'll also note that the tests are currently failing. That's because of a drop of coverage - there's no code testing the 2 if statements that have been added. To test these, you'll need to mock the behavior of sys.platform and date so that you can test (for example) what would happen if you ran this branch of code in January 2040.
EOL_year = today.year - 2024 # increment this each year past 10-2024 | ||
if today.month > 10: | ||
EOL_year += 1 | ||
if python_version[0] < 3 or ( |
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.
version < 3 can't ever happen; Briefcase can't be installed on Python 2.
"""Validate the system's python version is not past its EOL date.""" | ||
python_version = sys.version_info | ||
today = date.today() | ||
EOL_year = today.year - 2024 # increment this each year past 10-2024 |
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.
A short description of the math being used here would be helpful - why is 2024 important? Should this number be updated every year? Also, in any description, it's more helpful to say "October" than "10" because it's clear we're referring to a month.
Added a validation function for the system's python version, warning if it is past it's end of life date, based on the dates from here: https://devguide.python.org/versions/.
Fixes #1669
PR Checklist: