Search code examples
pythongitgithubpippypi

requirements.txt file for my package missing from PyPI install and tarball


I followed the instructions from http://peterdowns.com/posts/first-time-with-pypi.html in order to add my github hosted python package to PyPI. However when I try to pip install it and it runs my setup.py I get that the requirements.txt file is missing. When I manually download the tarball file from https://github.com/<username>/<mypackage>/archive/0.1.tar.gz I find that all the files are there. However when I click the download link on the PyPI page for my package it downloads a .tar.gz archive which only contains the python files, the config file and a PKG-INFO file it appears to have created.

The other files are all gone, why is this and how might I fix it?


Solution

  • setuptools by default chooses which files to include automatically based on your modules added -- by default this generally just means your python files and __init__.py files.

    To specify other files that need to be included in your source distribution, you can add a MANIFEST.in file to graft additional files into your source distribution.

    An example one which includes requirements.txt:

    include requirements.txt
    

    These can be come sufficiently more complicated

    To find all the things that MANIFEST.in supports, you can read its documentation here.