-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Python 3.8 #9774
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #9774 +/- ##
==========================================
- Coverage 95.84% 95.81% -0.04%
==========================================
Files 174 174
Lines 18878 18860 -18
==========================================
- Hits 18094 18070 -24
- Misses 784 790 +6
|
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 really great. I'm not sure we should remove the functional tests for py38/py39 (unless it's actual max_pyver=3.8) ?
@@ -41,7 +41,6 @@ class MethodArgsChecker(BaseChecker): | |||
"positional-only-arguments-expected", | |||
"Emitted when positional-only arguments have been passed as keyword arguments. " | |||
"Remove the keywords for the affected arguments in the function call.", | |||
{"minversion": (3, 8)}, |
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.
Shouldn't we replace this with a py-version check ?
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.
Hmm, but if my library supports 3.7 - 3.12, and I'm using a 3.8 function with positional-only arguments in the wrong manner, wouldn't I rather continue to see the message even if --py-version=3.7
, because I certainly have bigger problems anyway if I'm using a 3.8+ function when I supposedly support 3.7?
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 thought --py-version
was most helpful for ensuring we silence suggestion-style messages that don't make sense on lower versions, like consider-using-f-string
, but here we have a message that won't ever get raised on a lower version anyway, so I don't think we need to add a --py-version
workaround for it.
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 agree with Jacob's second comment. I don't think it will add much benefit to spend the time to add support for that edge case. Removing this line is fine.
I may not be following exactly, but it's worth remembering this: max_pyver=3.9 means run on 3.8 and below. I'd rather that be what happens when you put max_pyver=3.8, but it is what it is π€· . So anything with max_pyver=3.9 won't run when 3.9 is the minimum version and can be deleted, is my understanding. |
Yeah, didn't have that in mind either π I'm feeling like making a breaking change, it's likely that (mainly) only us pylint maintainers use that atm. I never saw a plugin with functional tests in the wild. I'll re-review with that in mind later. |
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.
Awesome job!
Just one comment from me.
There are some functional tests where it would have been nice to convert them to be messages when py-version==3.7
but that is a lot of work and I don't think is something we should focus our limited time on.
@@ -41,7 +41,6 @@ class MethodArgsChecker(BaseChecker): | |||
"positional-only-arguments-expected", | |||
"Emitted when positional-only arguments have been passed as keyword arguments. " | |||
"Remove the keywords for the affected arguments in the function call.", | |||
{"minversion": (3, 8)}, |
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 agree with Jacob's second comment. I don't think it will add much benefit to spend the time to add support for that edge case. Removing this line is fine.
af1dc5a
to
3654b84
Compare
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.
π
3654b84
to
ce7698f
Compare
Last push resolves merge conflict with #9777 |
ce7698f
to
4b45192
Compare
Latest push to resolve merge conflict |
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.
Sorry I wasn't able to review faster.
I feel like we're loosing a lot of valuable interpreter specific knowledge that could be integrated in py-version when we remove functional tests that ran only for EOL interpreters without looking in detail at what's happening. We already did that in the past but I think it's makingpy-version
kinda weak and 3.8 is easier to support than 3.7 because the ast's column/line is so much closer with other interpreters. I don't know if you looked at each test in detail and cleaned up the copy pastes or simple removed the one that ran only on EOL interpreters, Jacob ? There's a lot to review there I still didn't do it, but I feel like, for example, the carefully crafted tests about typing in python 3.8 from g/generic_alias/generic_alias_collections_py37.py
brought a lot of value and the removal is going to hurt when someone open issues postfaced "I use py-version 3.8, pylint should not suggest impossible things for my interpreter, it was working fine in old version".
@@ -61,7 +61,6 @@ test runner. The following options are currently supported: | |||
|
|||
- "min_pyver": Minimal python version required to run the test | |||
- "max_pyver": Python version from which the test won't be run. If the last supported version is 3.9 this setting should be set to 3.10. | |||
- "min_pyver_end_position": Minimal python version required to check the end_line and end_column attributes of the message |
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.
Not sure we should remove this, sometime there's a new column/line in a new version. In particular when a bug is fixed or a nodes end is adjusted (in cpython). When this is the case we choose the newer version. This is still true in new interpreters. (Introduced when dealing with 3.9 only column change afair ?)
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 for the explanation, will revert.
self._linter._arg_parser.add_argument( | ||
"--min_pyver_end_position", type=parse_python_version, default=(3, 8) | ||
) |
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.
Default was 3.8 and should become None
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.
Leaving this as 3.8 for now because it's strongly typed as a tuple.
Thanks for the review Pierre, and sorry for rushing you.
I just removed tests that ran only on EOL interpreters. If there are tests showing functionality that we can capture with py-version, I'm more than happy to make a new issue and itemize each one showing whether it's been investigated. It feels more "useful and optional" than dropping python 3.8, which I think we needed to do this summer, and I had a day to do it.
This is where I was at too, but as I mentioned above I'm happy to stub out an issue to investigate. I have separate commits in this PR to make this easier. However...
I'm not sure I see what we can salvage here. How are we going to know to raise |
Python 3.8 was EOL on 2024-10-07 (see https://devguide.python.org/versions/). See https://github.com/nmlorg/metabot/actions/runs/11828441666/job/32959263533 (pylint-dev/pylint#9774).
Remove support for launching pylint with Python 3.8.
Code that supports Python 3.8 can still be linted with the
--py-version=3.8
setting.Type of Changes