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

Script: remove pkg_resources namespace declarations #183

Open
gforcada opened this issue Oct 14, 2023 · 3 comments
Open

Script: remove pkg_resources namespace declarations #183

gforcada opened this issue Oct 14, 2023 · 3 comments
Labels
04 type: enhancement making existing stuff better 12 prio: high should be fixed soon 43 lvl: complex for wizards

Comments

@gforcada
Copy link
Member

At some point, Plone 7(?), we should remove the already deprecated pkg_resources on __init__.py files to switch to native namespaces:

https://packaging.python.org/en/latest/guides/packaging-namespace-packages#native-namespace-packages

As that's meant to be a coordinated effort that has to happen on a 0-day, having a script to try apply that to the plone namespace would be critical.

@gforcada gforcada added 04 type: enhancement making existing stuff better 12 prio: high should be fixed soon 43 lvl: complex for wizards labels Oct 14, 2023
@gforcada gforcada changed the title Script: remove pkg_resources namespace declarations Script: remove pkg_resources namespace declarations Oct 14, 2023
@mauritsvanrees
Copy link
Member

This does not have to be done in a single day. See my comment on zopefoundation/meta:

  • You can install old and new style packages together.
  • But editable installs get tricky.

So still it would be good to do this fast for a lot of packages, and quickly make alpha releases afterwards.

I think the time to do this would be somewhere in the second half of 2024.

@jensens
Copy link
Member

jensens commented Nov 23, 2023

Btw.: We should remove the whole namespace level __init__.py. They are not needed any longer with PEP420.

@jensens
Copy link
Member

jensens commented Nov 23, 2023

That said: I just played with PEP420 at the collective.elastic.plone package https://github.com/collective/collective.elastic.plone/tree/2-overhaul
It works. collective.elastic.ingest as its dependency is PEP420 too.
Both as editables here at the moment.

As an wheel there is collective.monkeypatcher as core dependency and this works too.
I am pretty sure it stops working if we install it as editable.

One observation: zope testrunner stops working, it does not discover tests in pep440 packages.
Good news: pytest with pytest-plone works, if the __init__.py from the tests folder was removed.
I just moved the whole tests folder to the top level, which works too, but I am not sure if this is the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
04 type: enhancement making existing stuff better 12 prio: high should be fixed soon 43 lvl: complex for wizards
Projects
None yet
Development

No branches or pull requests

3 participants