-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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.8 #17492
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Not sure why the Windows (>=3.9) uses the absolute file path when Linux and MacOS use the relative one. Maybe someone with a Windows system can help debug this? |
Not sure why the difference either. The closest change in Python 3.9 related to this I could find is the second bullet point here https://docs.python.org/3/whatsnew/3.9.html#other-language-changes but it doesn't explain the difference in behavior between operating systems. It is probably safe to just shorten the file paths in the output traceback before comparing it with the expected output. I tried this patch with the test case "mypyc/test/test_run.py::TestRun::run-loops.test::testForIterable" and it seems to fix the issue: diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py
index 37de192a9..112074047 100644
--- a/mypyc/test/test_run.py
+++ b/mypyc/test/test_run.py
@@ -315,6 +315,7 @@ class TestRun(MypycDataSuite):
# TODO: testDecorators1 hangs on 3.12, remove this once fixed
proc.wait(timeout=30)
output = proc.communicate()[0].decode("utf8")
+ output = output.replace(f' File "{os.getcwd()}{os.sep}', ' File "')
outlines = output.splitlines()
if testcase.config.getoption("--mypyc-showc"): It is kind of a hack but I don't know how to fix it otherwise. Off-topic: why not use a more recent python version like 3.12 or 3.11 for Windows tests so that we don't have to update it every year? |
Co-authored-by: Ali Hamdan <[email protected]>
Thanks! Yeah, that seems to be the culprit. Pushed our patch as it's probably the best way forward here, especially since the path deviates depending on the OS used to run the tests.
I don't know the exact reason but I believe the intention is to always test the "oldest" Python release with Windows. Anyway, the issue mentioned earlier persists even in newer versions. That was one of the first things I checked. |
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
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.
Thanks, looks good. I think nice to drop support a little closer to 3.8 end of life, let's at least wait until the 1.11 release is out.
I think mypy 1.12 at least should probably still support 3.8. That way we might have a release that supports both 3.13 and 3.8. Runtime support for 3.8 is needed for projects that use mypyc and target 3.8, since it's not possible to run mypyc on a more recent Python version and target an older version. |
One option of course. Though I'm not sure that's really necessary. We didn't do that the last time. |
Yeah it doesn't seem necessary, but if it doesn't take any significant effort, I think it's still worth doing. 3.8 still appears to be more popular than 3.9 or 3.12, based on PyPI stats (https://pypistats.org/packages/mypy). |
Similar to last year (#15566), start by dropping support for running mypy with Python 3.8.
Users will still be able to type check 3.8 code with
--python-version 3.8
until typeshed drops the support for it.It's a bit early as the EOL for Python 3.8 is in ~3 months. However, since the branch for
1.11.0
has been cut already, we'd only drop the support with1.12.0
which isn't due for another 1-2 months. Additionally dropping3.8
now will make it easier to support3.13
with its C-API changes and also give us enough time to cleanup the remaining 3.8 code blocks and documentation references.