Search code examples
pythonpython-3.xmanifestpackaging

Where are the data files included in MANIFEST.IN stored?


I have this small program do it with Python3.5 with the following structure:

awesome_gui/
    app.config
    MANIFEST.in
    setup.py
    awesome_gui/
       __init__.py
       main.py  

setup.py:

#!/usr/bin/env python

import os
from setuptools import setup


setup(
    name = "awesomegui",
    version = "1.0",
    author = "Me",
    author_email = "me@example.com",
    description = "Awesome GUI",
    packages=['awesome_gui'],
    entry_points = {
    'console_scripts': ['awesomegui=awesome_gui.main'],
    },
    include_package_data=True,
)

MANIFEST.in

include app.config

After execute the following line and create the .deb:

$ python3 setup.py --command-packages=stdeb.command bdist_deb

And unpack with:

$ sudo dpkg -i deb_dist/python3-awesomegui_1.0-1_all.deb

The code (*.py) is saved in /usr/lib/python3/dist-packages/awesome_gui/. But I do not see where app.config is saved.

Does anyone know where the data files that are non-code are stored?

Thank you!


Solution

  • Because people have asked me how I solved the problem, I describe it below. I did the following with respect to the initial approach:

    • I changed the structure of the initial project to this one:

      awesome_gui/
          MANIFEST.in
          setup.py        
          awesome_gui/
              app.config
              src/
                  __init__.py
                  main.py  
      

    You can see that the app.config file has been moved into the awesome_gui/ project folder and a folder named src has also been created and the code moved into it.

    • setup.py file was also edited:

      #!/usr/bin/env python
      
      import os
      from setuptools import setup
      
      
      setup(
          name = "awesomegui",
          version = "1.0",
          author = "Me",
          author_email = "me@example.com",
          description = "Awesome GUI",
          packages=['awesome_gui',
                    'awesome_gui.src',
                    ],
          entry_points = {
          'console_scripts': ['awesomegui=awesome_gui.src.main:main'],
          },
          include_package_data=True,
          package_data={"awesome_gui": ['app.config']},
       )
      

    Added src folder in packages and in entry_points fields. Also added the package_data field with the non python file.

    • By adding a folder level, the MANIFEST.in was also modified:

      include awesome_gui/app.config
      

    After installing with the commands, with these steps I got the non python files to be in the /usr/lib/python3/dist-packages/awesome_gui/ folder.