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
ENH: switch mpl_toolkits to implicit namespace package (PEP 420) #25381
base: main
Are you sure you want to change the base?
Conversation
f9abea4
to
086e7c3
Compare
`PEP 420 <https://peps.python.org/pep-0420/>`_. | ||
|
||
This change should be backward compatible. In case of problems please `file an issue on GitHub | ||
<https://github.com/matplotlib/matplotlib/issues/new/choose>`_. |
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.
While I sort of think it is a good idea to point directly to "New issue", it may still be better to point to the issues. If nothing else to avoid duplicates (if any...). But I'd wait and hear what other say.
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 this is implicit (other wise would would put this on every change note!).
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.
should I just drop line 8 and 9 then ?
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.
done !
setup.py
Outdated
@@ -301,7 +301,6 @@ def make_release_tree(self, base_dir, files): | |||
|
|||
package_dir={"": "lib"}, | |||
packages=find_packages("lib"), |
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.
Does this need to be changed to find_namespace_packages
?
The docs for setuptools indicate that packages without __init__
will be omitted, and as mpl_toolkits no longer has a __init__
I suspect it falls into that category
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.
Good catch, I missed that ! I just updated the PR to include this. I don't have time right now to verify that it's safe to leave include
and exclude
empty, but I can spend more time on it tomorrow if needed
Building the wheels as this change affects packaging |
086e7c3
to
fabec26
Compare
I ran Missing
Wrongly included
|
I realized that |
8d0cd58
to
63afcd3
Compare
https://github.com/matplotlib/matplotlib/actions/runs/4348842943 is an example run of the build-wheels on main (to save CI time we mostly do not build the wheels on every PR commit, but do build them on every merge to main and on the PRs we have the tag on). |
thanks !
effectively this means that, in order to exclude |
63afcd3
to
5b8ae1b
Compare
I think we only hove one namespace package (mpl_toolkits) and I am very 👎🏻 on adding any more. Maybe we should just hard-code the one we have and leave it at that? |
That would be my preference too. Unfortunately using packages=find_packages("lib"),
namespace_packages=["mpl_toolkits"], just like on the main branch, doesn't work:
I'm tended to think that's a shortcoming of |
Any reason we can't just do That adds the one implicit namespace package we want while ignoring the edgecase behavior of excludes. I mean, I may suggest a comment to indicate that it is namespace package related/that |
There is now discussion going on upstream with projects (e.g. zope and plone) who use this orders of magnitude more than we so it might be worth seeing how that shakes out. |
@tacaswell can you link those discussions here ? |
PR Summary
closes #25244
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst