I want to include a config file config.conf
in the root of a Python namespace package as a package data resource.
For example with the following project directory structure:
repository_root/
├── mynamespace/
│ └── mypackage/
│ ├── __init__.py
│ └── ...
├── config.conf
├── setup.cfg
└── ...
I have the following in setup.cfg
:
[options.package_data]
mynamespace.mypackage = *.conf
But when I build a wheel with python -m build -w
and I examine the content of the wheel the file config.conf
is not included in the .whl
zipped wheel archive.
Also if I create a source distribution with python setup.py sdist
then again the file is not included in the tar.gz
archive.
If the config.conf
is placed under mypackage
as in the following:
repository_root/
├── mynamespace/
│ └── mypackage/
│ ├── __init__.py
│ └── config.conf
└── ...
Then config.conf
is included in the wheel.
So how to include a file in the package root?
Later on, I noted that adding a MANIFEST.in
file with:
include config.conf
Does result in the file being correctly included in the tar.gz
when a source distribution is created with python setup.py sdist
when it is located in repository_root.
But the file is still not included in a wheel built via python -m build -w
.