Incorrect documentation on requirements.txt format
See original GitHub issueWhile attempting to fix an issue in pip-tools, it was discovered that the documentation for the requirements.txt
format conflicts with the actual behaviour of pip
when it parses a requirements.txt
file.
The documentation for requirements.txt format mentions Comments are stripped before line continuations are processed.
but the pip code appears to do the opposite, processing the line continuations before it strips the comments.
Which one is correct?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Requirements File Format - pip documentation v22.3.1
Requirements files serve as a list of items to be installed by pip, ... Files that use this format are often called “pip...
Read more >Invalid "requirements_file": path docs/requirements.txt does ...
This is particularly strange because the repo clearly has a docs/requirements.txt file. What could be causing this?
Read more >pip fails to install packages from requirements.txt
I am trying to install a python software using the requirements file. >> cat requirements.txt Cython ...
Read more >Errors while running pip install -r requirements.txt
Hi,. I have same problem when I run the command in virtualenv in Window Command Prompt. (mflix_venv) C:\Program Files\MongoDB\M220P\mflix-python ...
Read more >Why and How to make a Requirements.txt - Robert Boscacci
In short, we generate and share requirements.txt files to make it easier for other developers to install the correct versions of the required...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I made an experiment (#8094) and swapped the lines to see what happens. Two tests
test_comments_and_joins_case1
andtest_comments_and_joins_case3
are failed, see the tests:https://github.com/pypa/pip/blob/a531a15376ae8ee9670c1ab15262876a96624b97/tests/unit/test_req_file.py#L76-L100
Since this case:
is pretty legit and well tested, thus we may assume that there is a bug in documentation rather than in code.
Just in case it’s missed, all that’s needed IMO is #7780.