Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Python: Don't blindly include requirements.txt #304

Closed
brutasse opened this issue Dec 4, 2012 · 3 comments · Fixed by #305

Comments

@brutasse
Copy link
Contributor

@brutasse brutasse commented Dec 4, 2012

I tried to package salt, a python package which has the following requirements:

# pip requirements file for Salt
Jinja2
M2Crypto
msgpack-python
pycrypto
PyYAML
pyzmq >= 2.1.9

fpm -t deb -s python salt fails with the error:

Unable to parse dependency {"level":"error","dependency":"# pip requirements file for Salt"}
Invalid package configuration: Invalid dependency '# pip requirements file for Salt' {"level":"error"}

Comments are valid in pip requirements, as well as options for pip. Such a requirements file is valid:

--index-url https://my.private.pypi.server/index/
# some requirements
foo==1.0
bar
# More requirements
baz==0.2

I'm not asking for fpm to support specifying pip options in requirements files but it seems it'd be useful to parse the requirements and filter what lines are included. What do you think?

For more background information: http://www.pip-installer.org/en/latest/requirements.html

@jordansissel

This comment has been minimized.

Copy link
Owner

@jordansissel jordansissel commented Dec 4, 2012

@brutasse - I totally misread the docs for requirements.txt when implementing this, good catch :)

jordansissel added a commit that referenced this issue Dec 4, 2012
Fix #304 Ignore comments in requirements.txt
@r4um

This comment has been minimized.

Copy link
Contributor

@r4um r4um commented Dec 4, 2012

Looking over at various pip packages not ignoring # seems like a show stopping problem. Rest of the fancy formats
can be handled later.

@brutasse

This comment has been minimized.

Copy link
Contributor Author

@brutasse brutasse commented Dec 4, 2012

@jordansissel @r4um thanks! 🍻

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014
prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014
Fix jordansissel#304 Ignore comments in requirements.txt
prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014
prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014
r4um added a commit that referenced this issue Apr 24, 2015
jordansissel added a commit that referenced this issue Apr 24, 2015
Fix #304 Ignore comments in requirements.txt
jordansissel added a commit that referenced this issue Jun 20, 2016
Fix #304 Ignore comments in requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.