Skip to content

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

Merged
merged 3 commits into from
Apr 27, 2017
Merged

Drop Python 3.2 support. #3244

merged 3 commits into from
Apr 27, 2017

Conversation

gvanrossum
Copy link
Member

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.

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."

@ilevkivskyi
Copy link
Member

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

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?

Copy link
Member Author

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.

Guido van Rossum added 2 commits April 26, 2017 09:26
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.
@gvanrossum
Copy link
Member Author

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

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.

@gvanrossum
Copy link
Member Author

Added.

@JukkaL JukkaL merged commit 8434c8a into master Apr 27, 2017
@gvanrossum gvanrossum deleted the drop-3-2 branch April 28, 2017 00:17
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.

3 participants