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

Switch to PEP 420 native namespaces #491

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Switch to PEP 420 native namespaces #491

wants to merge 3 commits into from

Conversation

erral
Copy link
Member

@erral erral commented Feb 17, 2025

No description provided.

@erral erral requested a review from mauritsvanrees February 17, 2025 07:27
Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

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

I made a few minor changes. For example we do need to call find_namespace_packages in setup.py.

Why did you change the minimum required Python to 3.11? Did you hear a rumour somewhere? I am not planning to change it, it should just be 3.10. I have updated the branch.

In .meta.toml we should add some lines for good measure:

[tox]
constraints_file = "https://dist.plone.org/release/6.2-ev/constraints.txt"

But then we would need to call plone/meta on it, which makes too many changes.

@erral
Copy link
Member Author

erral commented Feb 19, 2025

I made a few minor changes. For example we do need to call find_namespace_packages in setup.py.

Why did you change the minimum required Python to 3.11? Did you hear a rumour somewhere? I am not planning to change it, it should just be 3.10. I have updated the branch.

No, sorry, I wanted to update it to the actual version, and thought that it was 3.10.

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

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

I have rebased on master, squashed the commits, added 6.2-dev as constraints, and have force pushed.

LGTM now, but we should not merge yet until the moment is there that we really start moving all plone packages to native namespaces.

@erral
Copy link
Member Author

erral commented Feb 19, 2025

I have rebased on master, squashed the commits, added 6.2-dev as constraints, and have force pushed.

LGTM now, but we should not merge yet until the moment is there that we really start moving all plone packages to native namespaces.

Perfect, that's why this is a draft PR

`tox -e dependencies` complained:

```
Missing requirements
====================
     i18ndude.catalog
     utils.PRODUCTS
     utils.getLanguage
     utils.getLongProductName
     utils.getPoFiles
     utils.getPoFilesAsCmdLine
     utils.getPoFilesByLanguageCode
     utils.getPotFiles
     utils.getProduct
     utils.getProductPath
```

This indicates that our top level `utils` directory is regarded as a package, which it should not.

You already see this a bit in coredev 6.1, where our `utils` module is unnecessarily available:

```
$ bin/zopepy
>>> import utils
>>> utils
<module 'utils' (namespace) from ['/Users/maurits/community/plone-coredev/6.1/src/plone.app.locales/utils']>
```

The same happens for `docs` and `news` in multiple packages:

```
>>> import docs
>>> docs
<module 'docs' (namespace) from [
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.caching/docs',
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.locales/docs',
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.upgrade/docs',
  '/Users/maurits/community/plone-coredev/6.1/src/Products.CMFPlone/docs']>
>>> import news
>>> news
<module 'news' (namespace) from [
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.caching/news',
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.locales/news',
  '/Users/maurits/community/plone-coredev/6.1/src/plone.app.upgrade/news',
  '/Users/maurits/community/plone-coredev/6.1/src/plone.schema/news',
  '/Users/maurits/community/plone-coredev/6.1/src/Products.CMFPlone/news']>
```

So it is nothing new, we are already doing something wrong and nothing bad really happens, but let's gradually improve. :-)
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.

2 participants