-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix flagging undeprecated importlib.resources functions #10595
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
Conversation
DanielNoord
left a comment
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.
Could you add a changelog entry? Our documentation explains how to do this :)
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10595 +/- ##
=======================================
Coverage 95.95% 95.95%
=======================================
Files 176 176
Lines 19476 19476
=======================================
Hits 18689 18689
Misses 787 787
π New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
pylint/checkers/stdlib.py
Outdated
| "importlib.resources.contents", | ||
| "importlib.resources.is_resource", | ||
| "importlib.resources.open_binary", | ||
| "importlib.resources.open_text", | ||
| "importlib.resources.path", | ||
| "importlib.resources.read_binary", | ||
| "importlib.resources.read_text", | ||
| # "importlib.resources.read_text", #un-deprecated in Python 3.13 |
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.
Please also check if any other ones from importlib.resources are falsely marked as deprecated as well. https://docs.python.org/3/library/importlib.resources.html
I believe everything except importlib.resources.contents could be removed and the deprecation of contents was moved from 3.9 to 3.11.
67893df to
18b379d
Compare
0b2752d to
6ea0e27
Compare
pylint/checkers/stdlib.py
Outdated
| "binascii.a2b_hqx", | ||
| "binascii.rlecode_hqx", | ||
| "binascii.rledecode_hqx", | ||
| "importlib.resources.contents", |
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.
This should be moved to (3, 11, 0) as the deprecation was delayed.
https://docs.python.org/3/library/importlib.resources.html#importlib.resources.contents
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
135f947 to
ee70de3
Compare
This comment has been minimized.
This comment has been minimized.
9158d44 to
ee70de3
Compare
This comment has been minimized.
This comment has been minimized.
DanielNoord
left a comment
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.
You'll need to make some small changes to the Changelog for the CI to agree with it. Is the error clear enough for you?
Iβve tried a few ways to update the Changelog to satisfy the CI, but Iβm still not sure what the exact format or placement should be. Could you please guide me on how to update the Changelog so that the pre-commit CI passes? |
99bddb2 to
ee70de3
Compare
1ad0861 to
ee70de3
Compare
ed879b1 to
b8a5155
Compare
This comment has been minimized.
This comment has been minimized.
cdce8p
left a comment
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.
Just two minor comments.
| No longer flag undeprecated functions in ``importlib.resources`` as deprecated. | ||
|
|
||
| Closes #10593 |
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.
Would you mind moving this to 10593.false_positive. That might be an even better fit.
Sorry for the confusion.
pylint/checkers/stdlib.py
Outdated
| (3, 11, 0): { | ||
| "locale.getdefaultlocale", | ||
| "locale.resetlocale", | ||
| "re.template", | ||
| "unittest.findTestCases", | ||
| "unittest.makeSuite", | ||
| "unittest.getTestCaseNames", | ||
| "unittest.TestLoader.loadTestsFromModule", | ||
| "unittest.TestLoader.loadTestsFromTestCase", | ||
| "unittest.TestLoader.getTestCaseNames", | ||
| "unittest.TestProgram.usageExit", | ||
| "importlib.resources.contents", |
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 think the idea is to have these entries sorted alphabetically, though I realize that's not done consistently. Would you mind moving importlib.resources.contents to the correct place at least?
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.
β
Renamed changelog fragment to 10593.false_positive as suggested.
β
Moved importlib.resources.contents into alphabetical order.
55ab345 to
d68a541
Compare
for more information, see https://pre-commit.ci
|
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit cbb3a43 |
cdce8p
left a comment
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 @Akshay9715 ππ»
(cherry picked from commit f941edd)
Type of Changes
Description
Refs #10593
Closes #10593
read_textfrom the list of deprecated functions inpylint/checkers/stdlib.py.tests/checkers/unittest_stdlib.py: