GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-98040: Remove find_loader, find_module and other deprecated APIs by warsaw · Pull Request #98059 · python/cpython

Conversation

@warsaw

@warsaw warsaw commented Oct 7, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Remove more deprecated importlib APIs from Python 3.12 #98040

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@warsaw
Checkpointing
e714588
@bedevere-bot bedevere-bot added the awaiting core review label Oct 7, 2022
@warsaw

warsaw commented Oct 7, 2022

Copy link
Copy Markdown
Member Author

Still lots of test failures and probably more things to remove, but it's a start!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

warsaw added 9 commits October 7, 2022 14:45
@warsaw
Remove deprecated classes from pkgutil
90ca658
@warsaw
Adjust some tests
571daa4
@warsaw
More test fixing
e798342
@warsaw
Remove more obsolete tests
acb5fb4
@warsaw
Remove some other PEP 302 obsolescence
40d9201
@warsaw
Use find_spec instead of load_module
455cc68
@warsaw
Remove more tests of PEP 302 obsolete APIs
bef8f9f
@warsaw
Remove another bunch of tests using obsolete load_modules()
96cdada
@warsaw
Merge branch 'main' into find_loader
d6adbd5
@warsaw
warsaw marked this pull request as ready for review October 7, 2022 23:14
@warsaw
Remove deleted names from __all__
897998f
@warsaw

warsaw commented Oct 7, 2022

Copy link
Copy Markdown
Member Author

@brettcannon @ericsnowcurrently Well, this branch is already getting pretty big. Pull a thread, unravel a sweater. There's still some things to do (see the ticket), but it's not too late to provide feedback. I was pretty aggressive in removing things that seemed to be obsolete or testing obsolete APIs, so hopefully I wasn't too eager to remove things. Feedback welcome!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

warsaw added 6 commits October 9, 2022 12:55
@warsaw
Merge branch 'main' into find_loader
1b514bb
@warsaw
Remove obsolete footnote
9708e1c
@warsaw
imp is removed
5e33c7e
@warsaw
Remove imp from generated stdlib names
73988d8
@warsaw
What's new and blurb
4832f66
@warsaw
More cleanup
64d16c9
However!  pip 22.2.2 still relies on pkgutil.ImpImporter so these things
cannot be removed until this issue is resolved:

pypa/pip#11501
@warsaw
warsaw requested a review from vsajip as a code owner October 9, 2022 22:54
@warsaw
Merge branch 'main' into find_loader
cbed6ce
@brettcannon

brettcannon commented Oct 14, 2022

Copy link
Copy Markdown
Member

Should this PR be a draft until the tests are passing?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@warsaw
warsaw marked this pull request as draft October 15, 2022 19:28
@warsaw

warsaw commented Oct 15, 2022

Copy link
Copy Markdown
Member Author

Should this PR be a draft until the tests are passing?

Yes, done. The blocker is being worked on upstream so I think pip 23.0 will likely unblock this PR. In the meantime, I'll keep the branch clean as is.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

warsaw added 4 commits October 15, 2022 12:30
@warsaw
Merge branch 'main' into find_loader
dd9d60f
@warsaw
Merge branch 'main' into find_loader
d61d2d6
@warsaw
Merge branch 'main' into find_loader
a801a7b
@warsaw
Merge branch 'main' into find_loader
8671f31
AA-Turner
AA-Turner reviewed Apr 29, 2023
View reviewed changes

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

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.

There's quite a few places in the docs where we need to update cross references as of this PR (mainly pre-fixing with an !) -- though as they're on lines too far from the changes I can't do inline suggestions.

Would you be happy for me to push to this branch with said docs cross-referencing changes?

A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/importlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@warsaw

warsaw commented May 1, 2023

Copy link
Copy Markdown
Member Author

Would you be happy for me to push to this branch with said docs cross-referencing changes?

Yes, this would be very helpful, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@warsaw
Merge branch 'main' into find_loader
3299a19
@warsaw warsaw self-assigned this May 1, 2023
warsaw and others added 4 commits May 2, 2023 05:55
@warsaw
Merge branch 'main' into find_loader
d06a9d0
@AA-Turner
Suppress cross-references to find_loader and find_module
41ed787
@AA-Turner
Suppress cross-references to Finder
378c3d9
@AA-Turner
Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader
d7100cb
@AA-Turner

AA-Turner commented May 2, 2023

Copy link
Copy Markdown
Member

Yes, this would be very helpful, thanks.

Done, thank you!

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@warsaw
Merge branch 'main' into find_loader
2e24b8b
@warsaw

warsaw commented May 2, 2023

Copy link
Copy Markdown
Member Author

Done, thank you!

Thank you!

AA-Turner reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@warsaw
warsaw requested a review from Yhg1s May 2, 2023 20:33
Yhg1s
Yhg1s approved these changes May 3, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 3, 2023
@warsaw
warsaw merged commit 3269978 into python:main May 3, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 3, 2023
@warsaw
warsaw deleted the find_loader branch May 3, 2023 11:55
@erlend-aasland erlend-aasland mentioned this pull request May 3, 2023
gh-104146: Remove unused 'second_pass_replacements' from clinic.py #104147
Merged
jaraco pushed a commit to python/importlib_metadata that referenced this pull request Jun 7, 2023
@warsaw @arhadthedev
@AA-Turner @jaraco
gh-98040: Backport python/cpython#98059
cc17826
Removed ``fixtures.NullFinder``.

---------

Co-authored-by: Oleg Iarygin <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
jaraco pushed a commit to python/importlib_metadata that referenced this pull request Jun 8, 2023
@warsaw @arhadthedev
@AA-Turner @jaraco
gh-98040: Backport python/cpython#98059
70a6075
Removed ``fixtures.NullFinder``.

---------

Co-authored-by: Oleg Iarygin <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@furkanonder furkanonder mentioned this pull request Jun 10, 2023
GH-63062: Implement __subclasshook__() for Finders and Loaders in abc lib #102763
Closed
clrpackages pushed a commit to clearlinux-pkgs/pypi-importlib_metadata that referenced this pull request Jun 20, 2023
@fenrus75
pypi-importlib_metadata: Autospec creation for update from version 6.…
1de6fa2
…6.0 to version 6.7.0

Barry Warsaw (1):
      gh-98040: Backport python/cpython#98059

Jason R. Coombs (21):
      Remove unnecessary and incorrect copyright notice. Fixes jaraco/skeleton#78.
      Replace flake8 with ruff. Fixes jaraco/skeleton#79 and sheds debt.
      👹 Feed the hobgoblins (delint).
      Make substitution fields more prominent and distinct from true 'skeleton' references. (#71)
      Suppress EncodingWarning in build.env. Ref pypa/build#615.
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Inline the NullFinder behavior.
      Add docstring to test_integration to give some context.
      Remove Python 2 compatibility in _compat.NullFinder.
      Move test_interleaved_discovery from test_integration to test_main.
      Remove test_search_dist_dirs as it was never used. Ref python/importlib_metadata#111.
      Extract _topmost and _get_toplevel_name functions.
      Extract _topmost and _get_toplevel_name functions.
      Capture that _get_toplevel_name can return None.
      Streamline the test to check one expectation (the standard dist-info expectation is handled by other tests above.
      Inline the symlink setup.
      Consolidate PackageDistributions tests.
      Update _path to jaraco.path 3.6 with symlink support.
      Utilize the new Symlink in preparing the test case.
      Update changelog.
      Remove '__init__.py', not needed.

Johan Herland (2):
      Add test to demonstrate issue with symlinked packages
      Attempt to fix issue with symlinked packages
@Ghost-LZW Ghost-LZW mentioned this pull request May 15, 2024
find_module is deleted in python3.13 vim/vim#14776
Closed
fumoboy007 added a commit to fumoboy007/intellij-community that referenced this pull request Sep 16, 2024
@fumoboy007
Implement MetaPathFinder.find_spec method in MyFinder subclass.
e97431c
The `MyFinder` subclass of [`MetaPathFinder`](https://docs.python.org/3.11/library/importlib.html#importlib.abc.MetaPathFinder) currently only implements the deprecated `find_module` method. That deprecated method was [removed](python/cpython#98059) in Python 3.12. This change adds an implementation for its replacement method called `find_spec`.
@fumoboy007 fumoboy007 mentioned this pull request Sep 16, 2024
Implement MetaPathFinder.find_spec method in MyFinder subclass JetBrains/intellij-community#2847
Closed
fumoboy007 added a commit to fumoboy007/intellij-community that referenced this pull request Sep 16, 2024
@fumoboy007
Update six.py to version 1.16.0.
b336305
The included `six.py` is from version 1.9.0. This version is not compatible with Python 3.12, which [removed](python/cpython#98059) the deprecated `MetaPathFinder.find_module` method. This change updates `six.py` to version [1.16.0](https://github.com/benjaminp/six/blob/65486e4383f9f411da95937451205d3c7b61b9e1/six.py), which uses the replacement `MetaPathFinder.find_spec` method.
@fumoboy007 fumoboy007 mentioned this pull request Sep 16, 2024
Update six.py to version 1.16.0 JetBrains/intellij-community#2848
Closed
@tungol tungol mentioned this pull request Dec 16, 2024
Do we need to define importlib.abc.PathEntryFinder.find_spec() #103999
Open
intellij-monorepo-bot pushed a commit to JetBrains/intellij-community that referenced this pull request Jul 10, 2025
@fumoboy007 @intellij-monorepo-bot
Implement MetaPathFinder.find_spec method in MyFinder subclass.
12cfd48
The `MyFinder` subclass of [`MetaPathFinder`](https://docs.python.org/3.11/library/importlib.html#importlib.abc.MetaPathFinder) currently only implements the deprecated `find_module` method. That deprecated method was [removed](python/cpython#98059) in Python 3.12. This change adds an implementation for its replacement method called `find_spec`.

closes #2847

GitOrigin-RevId: b7ebb9f36ac87389298df14f0672ec037da004ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@arhadthedev arhadthedev arhadthedev left review comments
@AA-Turner AA-Turner AA-Turner left review comments
@Yhg1s Yhg1s Yhg1s approved these changes
@vsajip vsajip Awaiting requested review from vsajip
@brettcannon brettcannon Awaiting requested review from brettcannon brettcannon is a code owner
@encukou encukou Awaiting requested review from encukou
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@warsaw warsaw

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@warsaw @brettcannon @ericsnowcurrently @AA-Turner @Yhg1s @arhadthedev @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.