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

Use PEP 420: implicit namespace packages #967

Closed
emlys opened this issue Apr 29, 2022 · 3 comments · Fixed by #990
Closed

Use PEP 420: implicit namespace packages #967

emlys opened this issue Apr 29, 2022 · 3 comments · Fixed by #990
Assignees
Labels
in progress This issue is actively being worked on task Something needs to be done

Comments

@emlys
Copy link
Member

emlys commented Apr 29, 2022

natcap is a namespace package. We indicate that with the file src/natcap/__init__.py which contains

import pkg_resources
pkg_resources.declare_namespace(__name__)

Today I learned that that's outdated. If I'm understanding correctly, we can just delete src/natcap/__init__.py and it will work the same way.
https://stackoverflow.com/a/27586272/14451410
https://peps.python.org/pep-0420/
This isn't really an enhancement, just keeping up with changes in the python standards.

@emlys emlys added the task Something needs to be done label Apr 29, 2022
@emlys emlys added the critical for issues likely to obstruct the whole dev team (e.g. broken builds) label May 17, 2022
@emlys
Copy link
Member Author

emlys commented May 17, 2022

Bumping to critical because this is failing all builds. As of setuptools 62.3.0 released today, we should see a SetuptoolsDeprecationWarning warning us that the namespace_packages parameter to setup() is deprecated. But due to a bug (pypa/setuptools#3320) an error is raised instead.

@emlys emlys added the in progress This issue is actively being worked on label May 17, 2022
@emlys emlys self-assigned this May 17, 2022
@abravalheri
Copy link

Sorry for the disruption. Soon the new setuptools version will be available with the fix for the unexpected error (it should only be a warning).Thank you @emlys .

Please let me know if it does not work.

@emlys
Copy link
Member Author

emlys commented May 17, 2022

No worries @abravalheri, thanks for fixing it so quickly!

emlys added a commit to emlys/invest that referenced this issue May 26, 2022
@dcdenu4 dcdenu4 removed the critical for issues likely to obstruct the whole dev team (e.g. broken builds) label Jun 28, 2022
phargogh added a commit that referenced this issue Jul 14, 2022
* use PEP 420: implicit namespace package

* update api docs config for namespace package

* allow internationalization data to be included as a namespace 'package'

* missing import

* sphinx apidoc use implicit namespaces option #967

* restore setup package_data

* update docs requirements to keep up with other requirements files

* set language to en

* remove unused imports, refactor excluded modules

* Update doc/api-docs/conf.py

Co-authored-by: James Douglass <jamesdouglassusa@gmail.com>

Co-authored-by: James Douglass <jamesdouglassusa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress This issue is actively being worked on task Something needs to be done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants