-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Switch to PEP 420 (Implicit namespace packages) #3928
Comments
With some scripts and the GitHub CLI tool it might be easy to distribute the effort... we can create preparatory branches to switch, so the window of brokenness will not be that big... One last item that might be a good idea to also add in this massive breakage would be to also rename I will have some days off next week (and without kids!) so I will try to work on it. I already ported our internal packages at work to native namespaces, and before it bitrots I can re-apply the steps there 👍🏾 |
@gforcada Trying things out, preparing, making tooling, that would be great. But for clarity: please do not yet make the actual move to native namespaces on any package. That is really for Plone 7, so next year. I guess for a small namespace like I already had a problem after moving Indeed we could create a Going from |
Sure, I was not planning on merging anything 😄 but as you say, tooling needed some love as both Fortunately that is fixed now, but there might be other tooling ( The idea of creating a Otherwise, if we wait until we want to open the door for Plone 7 changes, and things are not ready, nor tried already (on CI), we might face a stressful point where we stall development while waiting for tooling to get fixed. See this funny issue in Anyway: there is a draft PR for Then we will need a Jenkins job to ensure it does work 🤖 |
@mauritsvanrees @gforcada In order to avoid the need for new major releases of all packages at the same time, could we do something like this to switch between namespace package implementations based on the Python major version? (in
Ah, no, of course we cannot, because native namespace packages require NOT having |
That is for |
Not sure how much is worth it, but an idea came across:
If we keep this releases parallel to the production ones, we don't have to wait until Plone 7 is open, for then to notice that, oops X and Y tooling/packages/dependencies are broken. I still need to add the jenkins job to run tests with the |
The problem with doing this now, is that this gets in the way of other changes that require a major version bump and that we want to include in Plone 6.x. Take for example
If we imagine it really happens this way, it can still be fixed, but it will be confusing:
So: I think best not do this. Crazy idea of my own:
|
Sample PR of moving to a src-layout and the changes needed then: plone/plone.app.event#384 |
Responsible Persons
Proposer: Maurits van Rees
Seconder:
Abstract
Move from
setuptools/pkg_resources
namespaces to native namespaces.This is a breaking change, so is for Plone 7.
Motivation
Use of
pkg_resources
fromsetuptools
is deprecated. Native namespaces have been available since Python 3.3 and are now the recommended and most easy way to define namespaces.Assumptions
Since it is best to move all packages within one namespace at the same time, we need to coordinate with Zope for the
Products
namespace.pip
andsetuptools
and other packaging related software. Bugs may be less likely to get a fix.setuptools
. There are other ways to handle packaging and distribution nowadays.pkg_resources
namespaces within the same namespace, but this depends on the tools that you use, and whether you make a development checkout of a package. A combination that works today, might fail tomorrow with a newersetuptools
orpip
version. It is best to move over all packages from a single namespace at the same time.zope.*
packages have moved to non-native namespaces, allplone.*
packages could still use the oldpkg_resources
-style namespaces.Proposal & Implementation
plone
organisation that are used by thePlone
package should move to native namespaces. Others too where possible, and where we have control.collective
namespace.3.x
, not3.0.x
.__init__.py
from the namespace packages. InProducts.CMFPlone
we would removeProducts/__init__.py
.browser
,profiles
, andtests
directories. There are multiple ways to do this, but I propose we use asrc-layout
as this is supposed to make everything automatic. For example moveProducts
tosrc/Products
. See discussion here. This is optional, but seems best. It avoids problems like this when movingzest.releaser
over to using native namespaces. It will make some QA code easier, for example inplone/meta
, because all code will be insrc
, instead of in any of{src, plone, Products, etc}
.setup.py
: this PLIP is not about getting rid ofsetuptools
. We must then declare setuptools as build backend inpyproject.toml
, which we are already starting to do in Plone 6.Products
namespace. The pure Zope community can use help from the wider Plone community in this.Products
namespace.plone.*
, includingplone.app.*
.collective
,plonetheme
,borg
,zc
,z3c
,repoze
,five
.plonetheme.barceloneta
andborg.localrole
.Deliverables
collective
namespace.Risks
zope.testrunner
was already updated, andz3c.dependencychecker
as well.Participants
Links:
setup.py
deprecated? Short answer: no.pkg_resources
cross_pep420_pkg_resources
(orcross_pkg_resources_pep420
but that is basically duplicate data). The takeaway from that table, is that currently you can install a pep420 (native) and apkg_resources
package within the same namespace under some conditions:The text was updated successfully, but these errors were encountered: