I've got a setup.py
file which looks like this:
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="foo",
version="1.0",
packages=find_packages(),
include_package_data=True,
package_data={
"": ["*"],
},
)
And a package foo
which looks like this:
foo/__init__.py
foo/bar.txt
When I run setup.py bdist
, the bar.txt
file is (correctly) included in the distribution… But when I use setup.py sdist
it isn't.
What's up with that? Am I misunderstanding the meaning of package_data
? Or is this a quirk of setuptools
?
There are different sources for selecting those files. The package_data is used for installing from the source tree. The build a source package you also need a MANIFEST.in file. It should contain something like recursive-include *.txt
, or whatever you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With