Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 545
heyitsbmo Avatar asked Jan 05 '23 16:01

heyitsbmo


1 Answers

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.

like image 95
noteness Avatar answered Jan 14 '23 21:01

noteness