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

Drop support for running with Python 3.7 #15566

Merged
merged 24 commits into from
Jul 3, 2023
Merged

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #15056

mypy/fastparse.py Outdated Show resolved Hide resolved
PY_MINOR_VERSION: Final = sys.version_info[1]

# Check if we can use the stdlib ast module instead of typed_ast.
import ast as ast3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we don't need this alias anymore, now that typed-ast is gone and we no longer support Python 2

Suggested change
import ast as ast3
import ast

Copy link
Collaborator Author

@hauntsaninja hauntsaninja Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, addressed the other comments! I'm not going to touch this one in this PR. The alias is used a lot in this file and would make this PR harder to review / the one character isn't really hurting anyone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, makes sense!

mypyc/test/test_run.py Outdated Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
hauntsaninja and others added 2 commits July 1, 2023 15:51
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@ikonst
Copy link
Contributor

ikonst commented Jul 1, 2023

While at it, look for [out version>=3.8] as in

 [out]
-old stuff
-[out version>=3.8]
 new stuff

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

setup.py Show resolved Hide resolved
mypy-requirements.txt Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jul 2, 2023

Yikes, what on earth is going on here https://github.com/python/mypy/actions/runs/5435243387/jobs/9884211218?pr=15566 ? Is it python/cpython#79325 ? Can anyone with a Windows system reproduce?

@github-actions

This comment has been minimized.

@hamdanal
Copy link
Collaborator

hamdanal commented Jul 2, 2023

The mypy tests pass on my machine (Windows 11, Python 3.8.10 same version as CI, 16GB RAM, Intel Core i7-8850H)

> tox run -e py38 --skip-pkg-install -- mypy/
py38: skip building and installing the package
py38: commands[0]> python -m pytest mypy/
======================================== test session starts ========================================
platform win32 -- Python 3.8.10, pytest-7.3.2, pluggy-1.2.0
cachedir: .tox\py38\.pytest_cache
rootdir: *******
configfile: pyproject.toml
plugins: cov-4.1.0, xdist-3.3.1
created: 6/6 workers
6 workers [10273 items]

...

===================== 10002 passed, 263 skipped, 8 xfailed in 723.44s (0:12:03) =====================
  py38: OK (724.12=setup[0.03]+cmd[724.09] seconds)
  congratulations :) (724.34 seconds)

I couldn't run mypyc tests as I don't have a compiler installed but the tests failing in CI pass here.

@github-actions

This comment has been minimized.

This reverts commit c3e4e25.
os: ubuntu-latest
toxenv: py
os: windows-latest
toxenv: py38
tox_extra_args: "-n 2"
Copy link
Member

@AlexWaygood AlexWaygood Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if my previous suggestion might have been bad; maybe this might be the thing that's breaking things? Maybe there's a reason that the windows py37 job was the only job that didn't have -n 2 passed to it...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't work :-/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i saw :(

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jul 3, 2023

Possible this is what #7964 and some of the other stubgen windows skips in that file was about

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja hauntsaninja merged commit 2edaf35 into python:master Jul 3, 2023
19 checks passed
@hauntsaninja hauntsaninja deleted the py37 branch July 3, 2023 01:59
JukkaL pushed a commit that referenced this pull request Jul 12, 2023
@davidhalter
Copy link

davidhalter commented Oct 21, 2023

@hauntsaninja Were the tests with # flags: --python-version 3.7 intentionally not moved?

Here is one:

[case testNamedTupleDefaults]
# flags: --python-version 3.7
from collections import namedtuple

I feel like these tests should probably not be removed, since they sometimes contain relevant tests that are otherwise not tested. I feel like at the moment these tests are not really run at all, which is kind of a shame. I might be wrong though.

@hauntsaninja
Copy link
Collaborator Author

Running with Python 3.7 is different from type checking targeting Python 3.7. This PR was about the former.

JelleZijlstra pushed a commit that referenced this pull request Mar 9, 2024

Some follow on from #15566.

Also add 3.12 to tox.ini.
fabiob added a commit to fabiob/cloudevents-sdk-python that referenced this pull request May 25, 2024
They dropped support for 3.7 in aug/2023, see:
python/mypy#15566
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.

(🎁) Deprecate python 3.7 support
5 participants