Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is setuptools not installing my "data files" named in MANIFEST.in?

Trying to use a MANIFEST.in file (contains one line):

recursive-include etc *

To install some files for systemd (yea, I'm holding my nose about that part)

I see the files get added to the tarball by sdist, but nothing will cause them to install.

setup.py contains the following lines

  packages=find_packages(),
  include_package_data=True,

Then if I add this to setup.py and remove the MANIFEST.in

  data_files=[
      ('etc/systemd/system/', ['etc/systemd/system/uwsgi.service'])
  ],

they install as expected. Is there something missing that I need to add for MANIFEST.in to work instead of enumerating all the files by name in setup.py?

like image 797
boatcoder Avatar asked Oct 18 '17 19:10

boatcoder


People also ask

How do I install packages on setuptools?

Follow the below steps to install the Setuptools package on Linux using the setup.py file: Step 1: Download the latest source package of Setuptools for Python3 from the website. Step 3: Go to the setuptools-60.5. 0 folder and enter the following command to install the package.

Do I need to install setuptools?

you generally don't need to worry about setuptools - either it isn't really needed, or the high-level installers will make sure you have a recent enough version installed; in this last case, as long as the operations they have to do are simple enough generally they won't fail.

Is setuptools deprecated?

setuptools in Python setuptools is a library which is built on top of distutils that has been deprecated (and up for removal as of Python 3.12).


Video Answer


1 Answers

package_data and data_files are not the same thing. package_data are files that are stored & installed in the same directory as your *.py files (hence the "package" part); include_package_data thus only marks data files it finds inside your package directories (emphasis added) as package data. Unless your code is stored under etc/ in your package source, none of your files will be treated as package data. In order to install files outside your Python package directory, you need to use data_files, and there is no shortcut as there is with include_package_data.

like image 177
jwodder Avatar answered Nov 14 '22 22:11

jwodder