Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

requirements.txt missing from sdist but setup.py relies on it #8

Open
joachimmetz opened this issue May 26, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@joachimmetz
Copy link
Contributor

joachimmetz commented May 26, 2020

Describe the bug

The sdist (source distribution package) https://files.pythonhosted.org/packages/01/62/b4260ba40f55af4a82e4fb5b41f381fa3bb0537489b8fa3efb713b6bbb00/mans_to_es-1.6.tar.gz does not contain requirements.txt but setup.py relies on it

To Reproduce
Steps to reproduce the behavior:

  1. Download and extract https://files.pythonhosted.org/packages/01/62/b4260ba40f55af4a82e4fb5b41f381fa3bb0537489b8fa3efb713b6bbb00/mans_to_es-1.6.tar.gz
  2. run: python setup.py build

Expected behavior
python setup.py build to complete successfully not give a traceback

Possible solutions
Add a MANIFEST.in file which contains requirements.txt, I'll prepare a PR

Additional context

python3 ./setup.py build
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/download.py", line 421, in get_file_content
    with open(url, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./setup.py", line 31, in <module>
    for req in parse_requirements("requirements.txt", session=PipSession(),)
  File "./setup.py", line 30, in <listcomp>
    str(req.req)
  File "/usr/lib/python3/dist-packages/pip/req/req_file.py", line 84, in parse_requirements
    filename, comes_from=comes_from, session=session
  File "/usr/lib/python3/dist-packages/pip/download.py", line 425, in get_file_content
    'Could not open requirements file: %s' % str(exc)
pip.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/download.py", line 421, in get_file_content
    with open(url, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./setup.py", line 36, in <module>
    for req in parse_requirements("requirements.txt", session=PipSession(),)
  File "./setup.py", line 35, in <listcomp>
    str(req)
  File "/usr/lib/python3/dist-packages/pip/req/req_file.py", line 84, in parse_requirements
    filename, comes_from=comes_from, session=session
  File "/usr/lib/python3/dist-packages/pip/download.py", line 425, in get_file_content
    'Could not open requirements file: %s' % str(exc)
pip.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt
@joachimmetz joachimmetz added the bug Something isn't working label May 26, 2020
@joachimmetz
Copy link
Contributor Author

joachimmetz commented May 26, 2020

Proposed fix: #9

To check the files in the sdist:

python3 setup.py sdist
...
tar tfv dist/mans_to_es-1.6.tar.gz | grep requirements.txt
-rw-rw-r-- user/user   186 2020-05-26 11:29 mans_to_es-1.6/requirements.txt

You'll also need to do another release to fix the sdist on PyPI

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant