Search code examples
pythonpipsetup.py

Dependencies file requirements-freeze.txt not found when installing my python package from corporate artifactory


My library is being installed from a corporate artifactory repo using the old-school setup.py . But the requirements-freeze.txt is not being found

$pip3 install --force-reinstall hercl --index https://pypi.myCompany.com/simple
Looking in indexes: https://pypi.myCompany.com/simple
Collecting hercl
  Using cached https://pypi.myCompany.com/hercl/hercl-0.3.35.tar.gz (19 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/steve/opt/miniconda3/envs/hercl3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-install-5cr4s0kr/hercl_b00c139d40874d4bb1ea73b8adadecdc/setup.py'"'"'; __file__='"'"'/private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-install-5cr4s0kr/hercl_b00c139d40874d4bb1ea73b8adadecdc/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-pip-egg-info-0zo1s0ho
         cwd: /private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-install-5cr4s0kr/hercl_b00c139d40874d4bb1ea73b8adadecdc/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-install-5cr4s0kr/hercl_b00c139d40874d4bb1ea73b8adadecdc/setup.py", line 58, in <module>
        freeze_requirements = get_requirements("requirements-freeze.txt")
      File "/private/var/folders/5c/wxs8mjgs2jj6zvsw3wxwmq480000gn/T/pip-install-5cr4s0kr/hercl_b00c139d40874d4bb1ea73b8adadecdc/setup.py", line 15, in get_requirements
        with open(file_path) as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements-freeze.txt'

That file along with the input requirements.txt are located in the root directory of the repo along with the setup.py. Why is it not found?

   project root
       |
         -- setup.py
         -- requirements-freeze.txt
         -- requirements.txt

Solution

  • I needed the following inside the MANIFEST.in:

    include *requirements*.txt