Can I add comments to a pip requirements file?

PythonCommentsPip

Python Problem Overview


I'd like to add comments for a few packages in a pip requirements file. (Just to explain why that package is on the list.) Can I do this?

I'm imagining something like

Babel==0.9.5 # translation
CherryPy==3.2.0 # web server
Creoleparser==0.7.1 # wiki formatting
Genshi==0.5.1 # templating

Python Solutions


Solution 1 - Python

Sure, you can, just use #

pip docs: > A line that begins with # is treated as a comment and ignored. Whitespace followed by a # causes the # and the remainder of the line to be treated as a comment.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionlofidevopsView Question on Stackoverflow
Solution 1 - PythonAlexander ArtemenkoView Answer on Stackoverflow