-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Drop Python 3.2 support. #3244
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
Drop Python 3.2 support. #3244
Conversation
I would vote for failing hard on Python 3.2. At least all Python 3 migration guidelines that I have seen recommend doing so. |
@@ -404,9 +404,9 @@ x = 1 | |||
[out] | |||
|
|||
[case testCustomSysVersionInfo] | |||
# flags: --python-version 3.2 | |||
# flags: --python-version 3.5 |
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.
Is it easy to add test cases for this change?
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 could add testcases to test-data/unit/cmdline.test like this:
[case testPython2VersionTooOld]
# cmd: mypy --python-version 2.6 -c pass
[out]
...
But a problem with that is that the output includes the full usage message, e.g.
usage: mypy [-h] [-v] [-V] [--python-version x.y] [--platform PLATFORM] [-2] [--ignore-missing-imports] [--follow-imports {normal,silent,skip,error}] (diff)
[--disallow-untyped-calls] [--disallow-untyped-defs] [--check-untyped-defs] [--disallow-subclassing-any] [--warn-incomplete-stub] [--warn-redundant-casts] (diff)
[--no-warn-no-return] [--warn-return-any] [--warn-unused-ignores] [--show-error-context] [-i] [--quick-and-dirty] [--cache-dir DIR] [--strict-optional] (diff)
[--strict-optional-whitelist [GLOB [GLOB ...]]] [--junit-xml JUNIT_XML] [--pdb] [--show-traceback] [--stats] [--inferstats] [--custom-typing MODULE] (diff)
[--custom-typeshed-dir DIR] [--scripts-are-modules] [--config-file CONFIG_FILE] [--show-column-numbers] [--find-occurrences CLASS.MEMBER] [--strict] (diff)
[--strict-boolean] [--cobertura-xml-report DIR] [--html-report DIR] [--linecount-report DIR] [--linecoverage-report DIR] [--memory-xml-report DIR] (diff)
[--old-html-report DIR] [--txt-report DIR] [--xml-report DIR] [--xslt-html-report DIR] [--xslt-txt-report DIR] [-m MODULE] [-c PROGRAM_TEXT] [-p PACKAGE] (diff)
[files [files ...]] (diff)
mypy: error: argument --python-version: Python 2.8 is not supported (must be 2.7) (diff)
which requires updating the tests frequently because the usage message changes each time we add a new flag.
Not sure I like tinkering with this more.
Tighten parsing of Python version on command line and in config file. The only versions now supported are: - 2.7 - 3.3 and higher 3.x versions Closes #3231.
OK how about this compromise? It checks the parse_version function via the config file. |
# cmd: mypy -c pass | ||
[file mypy.ini] | ||
[[mypy] | ||
python_version = 3.2 |
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.
Looks like there's no test that checks that 3.3 is still accepted? We only have a test that checks that 3.2 is rejected.
Added. |
Tighten parsing of Python version on command line and in config file.
The only versions now supported are:
Closes #3231.
TBH I'm not sure this is worth it. It may be enough to declare in the docs "The only supported Python versions are 2.7, 3.3 and higher."