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 Python 3.7 #8609

Merged
merged 3 commits into from
Apr 24, 2023
Merged

Drop support for Python 3.7 #8609

merged 3 commits into from
Apr 24, 2023

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Apr 23, 2023

Description

Python 3.7 will reach its EOL in two months (2023-06-27). I think it would make sense to drop support with the next release 3.0. That will allow us to cleanup even more old code.

I'm not proposing to remove the ability to lint 3.7 compatible code. If users want that, they can still set py-version=3.7.

Refs #6306

@codecov
Copy link

codecov bot commented Apr 23, 2023

Codecov Report

Merging #8609 (f2556fd) into main (3d036b7) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8609      +/-   ##
==========================================
- Coverage   95.92%   95.81%   -0.11%     
==========================================
  Files         174      174              
  Lines       18415    18317      -98     
==========================================
- Hits        17664    17551     -113     
- Misses        751      766      +15     
Impacted Files Coverage Δ
pylint/checkers/utils.py 95.65% <ø> (-0.41%) ⬇️
pylint/typing.py 100.00% <ø> (ø)
pylint/checkers/__init__.py 93.10% <100.00%> (-0.84%) ⬇️
pylint/checkers/base/basic_checker.py 97.86% <100.00%> (-0.03%) ⬇️
pylint/checkers/base/docstring_checker.py 97.67% <100.00%> (-0.08%) ⬇️
pylint/checkers/classes/class_checker.py 93.61% <100.00%> (-0.02%) ⬇️
pylint/checkers/format.py 96.46% <100.00%> (-0.05%) ⬇️
pylint/checkers/imports.py 94.31% <100.00%> (-0.03%) ⬇️
pylint/checkers/logging.py 94.73% <100.00%> (-0.14%) ⬇️
pylint/checkers/raw_metrics.py 100.00% <100.00%> (ø)
... and 18 more

... and 4 files with indirect coverage changes

@DanielNoord
Copy link
Collaborator

I would defer this choice to pylint-dev/astroid#2137 (comment), as I think this is where we will make the first/final decision about this.

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Apr 23, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0 milestone Apr 23, 2023
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

I would expect some change in the functional tests too (py 3.7 exclusive tests that now need a py-version to run).

@@ -108,6 +108,7 @@ disable=
format,
# We anticipate #3512 where it will become optional
fixme,
consider-using-assignment-expr,
Copy link
Member

Choose a reason for hiding this comment

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

I haven't considered that. This is (also) going to be a nice cleanup !

@cdce8p
Copy link
Member Author

cdce8p commented Apr 23, 2023

I would expect some change in the functional tests too (py 3.7 exclusive tests that now need a py-version to run).

This is just a first step. Besides the test cases, there are other areas which could be improved. Had to start somewhere.

Assignment expressions

Yeah, we could start using them with 3.8. Although I'm not sure we should enable the code-style check for it. Sometimes using := is an opinionated decision which the check just can't do.

@Pierre-Sassoulas
Copy link
Member

Regarding the functional tests we could have a regression if it never run in the CI, right ? (Added #6306 (comment) so we do not forget later)

@cdce8p
Copy link
Member Author

cdce8p commented Apr 23, 2023

Regarding the functional tests we could have a regression if it never run in the CI, right ? (Added #6306 (comment) so we do not forget later)

py-version isn't a full replacement. For example for bad-reversed-sequence we check the argument locals to see if it contains the __reversed__ protocol method. This will always be true when pylint is run with >= 3.8 so it can't detect an issue for 3.7. That's why I would usually recommend to run pylint with the lowest supported Python version.

However, as this is the only small regression I still think dropping 3.7 now is worth it. If someone really depended on it, he can continue to use pylint 2.17.x.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

I think the primer fail is expected in this PR. I'm a little worried that all MR will need to be rebased on main after we merge but I don't think we have a way to avoid that.

@cdce8p
Copy link
Member Author

cdce8p commented Apr 24, 2023

I think the primer fail is expected in this PR. I'm a little worried that all MR will need to be rebased on main after we merge but I don't think we have a way to avoid that.

Yeah, that's just the nature of these cleanups.
However, I would rebase on a need bases only, not proactive. It's likely some of the breaking changes in astroid will cause additional merge conflicts down the line.

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0, 3.0.0b1 Apr 24, 2023
@cdce8p cdce8p merged commit 3ff19e4 into pylint-dev:main Apr 24, 2023
@cdce8p cdce8p deleted the drop-py37 branch April 24, 2023 20:36
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0b1, 3.0.0a7 May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants