`include_package_data` doesn't work with `find_namespace_packages`
See original GitHub issueI’m trying to use namespace package discovery together with package data, and those two seem to conflict?
Snippet of setup.cfg
:
[options]
package_dir =
=src
packages = find_namespace:
include_package_data = True
[options.packages.find]
where = src
include_package_data = True
Stdout of trying that:
python setup.py build_py
running build_py
package init file 'src/sphinxcontrib/__init__.py' not found (or not a regular file)
package init file 'src/sphinxcontrib/elements/theme/__init__.py' not found (or not a regular file)
package init file 'src/sphinxcontrib/elements/theme/static/__init__.py' not found (or not a regular file)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Packaging namespace packages
Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages (referred to as ...
Read more >Package Discovery and Namespace Packages - Setuptools
Setuptools provides powerful tools to handle package discovery, including support for namespace packages. Normally, you would specify the packages to be ...
Read more >python - `pip install -t` doesn't work with namespace packages
It works when you do this: import site site.addsitedir('some_dir'). See https://docs.python.org/2/library/site.html#site.addsitedir.
Read more >Making a Python Package
The module search path¶. The interpreter keeps a list of all the places that it looks for modules or packages when you do...
Read more >R Packages (2e) - 11 Dependencies: Mindset and Background
Although it can be a bit confusing, R's namespace system is vital for the package ecosystem. It is what ensures that other packages...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @moooeeeep, if you are using the
src
-layout, currently[^1] you need also to specify in yoursetup.cfg
(in addition topackage_dir
):Please have a look on https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#using-a-src-layout for a more contextualized description.
[^1]: We are experimenting with some improved auto-discovery that might make this easier in the future, but for the time being you need the solution described above.
I stumbled upon a similar issue. Consider the package definition here: https://github.com/moooeeeep/python_package_data
Again, what seems to break the installation of my package’s data files, is the automatic package discovery.
I have this in my
setup.cfg
which works:Whereas this doesn’t (
pkgutil.get_data()
returnsNone
instead of the file contents):