According to docs https://packaging.python.org/en/latest/distributing/#data-files
setuptools will honor data_files
configed in setup.py. But i can't make it work. This is my setup.py:
setup(
name='booking_order',
version=version,
packages=find_packages(),
package_data={
'booking_order': ['fake_backends/static/*',
'scripts/*',
'*.sample'],
},
data_files=[
('/etc/booking', ['etc/booking.conf'])
],
This is the project's file tree:
.
├── booking_order
│ ├── __init__.py
│ ├── tests
│ │ ├── __init__.py
├── etc
│ ├── booking.conf
├── README.md
├── setup.py
The behavior is, if i run python setup.py install
, file etc/booking.conf
will got installed to /etc/booking
. But if i first python setup.py sdist upload
, then pip install booking_order
, there will be an error "error: can't copy 'etc/booking.conf': doesn't exist or not a regular file".
I checked python setup.py sdist
doesn't include files in etc at all.
EDIT:
it seems this is the answer: https://github.com/pypa/setuptools/issues/521