Skip to content

mypy: require Python 3.5.3 or greater #8384

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ env:

jobs:
include:
# Specifically request 3.5.1 because we need to be compatible with that.
- name: "run test suite with python 3.5.1 (compiled with mypyc)"
python: 3.5.1
- name: "run test suite with python 3.5.3 (compiled with mypyc)"
python: 3.5.3
dist: trusty
env:
- TOXENV=py
Expand Down
9 changes: 5 additions & 4 deletions mypy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,14 @@ def get_unique_redefinition_name(name: str, existing: Container[str]) -> str:
def check_python_version(program: str) -> None:
"""Report issues with the Python used to run mypy, dmypy, or stubgen"""
# Check for known bad Python versions.
if sys.version_info[:2] < (3, 5):
if sys.version_info < (3, 5):
sys.exit("Running {name} with Python 3.4 or lower is not supported; "
"please upgrade to 3.5 or newer".format(name=program))
# this can be deleted once we drop support for 3.5
if sys.version_info[:3] == (3, 5, 0):
sys.exit("Running {name} with Python 3.5.0 is not supported; "
"please upgrade to 3.5.1 or newer".format(name=program))
if sys.version_info < (3, 5, 3):
version = ".".join(map(str, sys.version_info[:3]))
sys.exit("Running {name} with Python {version} is not supported; "
"please upgrade to 3.5.3 or newer".format(name=program, version=version))


def count_stats(errors: List[str]) -> Tuple[int, int]:
Expand Down