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

gh-97850: remove find_loader and get_loader from pkgutil #119656

Merged
merged 17 commits into from
Nov 1, 2024

Conversation

picnixz
Copy link
Contributor

@picnixz picnixz commented May 28, 2024

@picnixz picnixz changed the title Remove find_loader and get_loader from pkgutil gh-#97850: remove find_loader and get_loader from pkgutil May 28, 2024
@picnixz picnixz changed the title gh-#97850: remove find_loader and get_loader from pkgutil gh-97850: remove find_loader and get_loader from pkgutil May 28, 2024
@picnixz picnixz changed the title gh-97850: remove find_loader and get_loader from pkgutil [3.14] gh-97850: remove find_loader and get_loader from pkgutil May 28, 2024
@picnixz
Copy link
Contributor Author

picnixz commented May 28, 2024

Quick question but how do you manage the whatsnews sections when a feature is being removed? I cannot really change it to :func:`!pkgutil.find_loader` since these are available in previous versions.

@picnixz picnixz changed the title [3.14] gh-97850: remove find_loader and get_loader from pkgutil gh-97850: remove find_loader and get_loader from pkgutil May 28, 2024
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Please, update

:func:`pkgutil.find_loader`
:func:`pkgutil.get_loader`

to be

:func:`!pkgutil.find_loader`
:func:`!pkgutil.get_loader`

Since all python versions have their own versions of 3.13.rst / 3.12.rst / etc.

@bedevere-app
Copy link

bedevere-app bot commented May 29, 2024

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixz
Copy link
Contributor Author

picnixz commented May 29, 2024

Yes, that's what I was actually asking. Should I just suppress every possible links in the others 3.x.rst files even though they exist? (if so, I can do it but I wanted to be sure that all references should be suppressed even for old versions for which the reference would exist).

@sobolevn
Copy link
Member

Again, older versions won't be affected, because they live in their own branches. And we won't backport this change.

@picnixz
Copy link
Contributor Author

picnixz commented May 29, 2024

Oh yes, it was dumb of me. I incorrectly assumed that the 3.12 page was for the corresponding branch (seems I'm still not entirely awake). Anyway, I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented May 29, 2024

Thanks for making the requested changes!

@sobolevn: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from sobolevn May 29, 2024 08:17
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Sorry, I somehow did not send this comment.

Lib/test/test_doctest/test_doctest.py Outdated Show resolved Hide resolved
@sobolevn sobolevn requested a review from brettcannon May 29, 2024 14:27
@picnixz
Copy link
Contributor Author

picnixz commented May 30, 2024

I'm not an expert in this since this predates the time when I started coding in Python (technically speaking, I've coded in 2.7 but never in 3.0 -- 3.5).

AFAIK, the pkgutil.extend_path function is not marked as deprecated even though namespace packages should not be declared through it anymore. However, if needs arise, I'd recommend removing extend_path in one go rather than removing a single portion of the code.

The main reason is: extend_path should not really be used since it's for declaring legacy namespace packages; but if someone really wants to use it, then it should do whatever it was meant to do.

In particular, having removed find_loader from pkgutil does not mean that a custom Finder object should not be used for extend_path.

Doc/whatsnew/3.13.rst Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <[email protected]>
@hugovk
Copy link
Member

hugovk commented Aug 2, 2024

This has a conflict after the #122085 re-org.

@picnixz
Copy link
Contributor Author

picnixz commented Aug 2, 2024

Oh, I forgot about this one :') I'll fix the conflicts err... I don't know when (I'm a bit busy writing something currently and don't know if I'll have tomorrow)

@hugovk
Copy link
Member

hugovk commented Aug 2, 2024

Thanks, absolutely no rush with this :)

@Wulian233
Copy link
Contributor

#123036
Need change

@brettcannon
Copy link
Member

@picnixz are you waiting on anything for this? You haven't triggered a request for a re-review.

@picnixz
Copy link
Contributor Author

picnixz commented Sep 17, 2024

Oh I forgot about it. This one is a low-priority task (which is why I didn't re-request a review) and we were waiting for more experts feedback (such as yours I think?) so we can address this issue when people have the time!

(I'll be barely present for the rest of the week)

@hugovk
Copy link
Member

hugovk commented Oct 15, 2024

Where are we up to here?

Our friends at Fedora, who do a huge amount of valuable early testing and fixing of Python packages, are asking about pending deprecations for 3.14:

https://discuss.python.org/t/if-you-plan-to-remove-deprecated-apis-from-python-3-14-please-do-it-now/67955

@picnixz
Copy link
Contributor Author

picnixz commented Oct 15, 2024

I always forget about this PR :D We actually waited for an expert on pkgutil to confirm that the removal is ok. Apart from that, I don't think I wanted to do more. I'll ask a round of re-review.

@brettcannon
Copy link
Member

We actually waited for an expert on pkgutil to confirm that the removal is ok

There is no pkgutil expert, hence the deprecation (that and it not plugging into importlib cleanly). 😉

@hugovk
Copy link
Member

hugovk commented Nov 1, 2024

Let's merge!

@hugovk hugovk merged commit 464a7a9 into python:main Nov 1, 2024
36 checks passed
@picnixz picnixz deleted the remove-deprecated-pkgutil branch November 1, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants