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

Add eol python warnings #1822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kaleJohn
Copy link

@kaleJohn kaleJohn commented May 21, 2024

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:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a 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 (
Copy link
Member

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
Copy link
Member

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.

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.

Add EOL Python warnings
2 participants