1

So I have a package as follows:

Dir
+---src
|   +---Package
|       +---__init__.py
|       +---Certs
|           +---SomeCertificate
|
+---setup.py
+---MANIFEST.in

my setup.py looks like this:

with open('requirements.txt') as f:
    required = f.read().splitlines()

setuptools.setup(
    name = 'myPackage',
    install_requires=required,
    package_dir = {
            '': 'src'},
    packages=find_packages(where='src'),
    include_package_data=True,
    zip_safe = False
)

and my MANIFEST.in looks like this:

recursive-include *

I want all folders, structure, and files in Package to be included when I do pip install myPackage but MANIFEST.in seems to be ignored - the Certs folder and its contents are not in the installed package's site-packages folder. Been looking through documentation but still can't work out what I'm doing wrong - anyone know?

WIlliam
  • 35
  • 5
  • "but MANIFEST.in seems to be ignored" What is your evidence for this? What happens when you run the command, and how is that different from what you expect to happen? – Karl Knechtel Aug 30 '21 at 06:25
  • Does https://stackoverflow.com/questions/24727709/do-python-projects-need-a-manifest-in-and-what-should-be-in-it help? – Karl Knechtel Aug 30 '21 at 06:27
  • No, I still can't get it to work, I just tried to do package_data={'myPackage:['*']} which did include files directly under myPackage folder into the site-package folder, but does not recursively find all folders and files – WIlliam Aug 30 '21 at 06:52
  • Maybe `recursive-include src *`. As far as I know `recursive-include` requires 2 parameters. – sinoroc Aug 30 '21 at 07:56

1 Answers1

2

try this:

# https://packaging.python.org/guides/using-manifest-in/
graft src/Package
global-exclude __pycache__
global-exclude *.py[cod]

graft dir-pattern Add all files under directories matching dir-pattern

cizario
  • 3,995
  • 3
  • 13
  • 27