Search code examples
pythonpipsetuptoolspython-wheeldevpi

Include requirements.txt file in Python wheel


To avoid specifying dependencies in two places, I have a Python project whose setup.py parses a requirements.txt file to generate the list of install_requires packages. This works great until I try to upload a wheel to a devpi server and then install it - I get the error that requirements.txt is not found.

Is it possible to build a distribution with the requirements.txt files next to setup.py? I've tried package_data and data_files, but the resulting distribution still didn't contain those files.


Solution

  • Just add a MANIFEST.in in the project folder with the content:

    include requirements.txt
    

    And it would include the file. You can also use wildcards like * too.