Skip to content

Fix parsing requirement version when inline comment exists #13

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

Merged
merged 2 commits into from
Jul 21, 2017

Conversation

pavdmyt
Copy link
Contributor

@pavdmyt pavdmyt commented Jun 12, 2017

Hi,

I'm using pypiup with pip-tools in my projects. pip-tools compiles requirements.txt and automatically fills dependencies as inline comments:

#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --output-file requirements-dev.txt requirements-dev.in
#
appnope==0.1.0            # via ipython
astroid==1.5.3            # via pylint
certifi==2017.4.17        # via requests
chardet==3.0.3            # via requests
click==6.7                # via pip-tools, pypiup
decorator==4.0.11         # via ipython, traitlets
first==2.0.1              # via pip-tools
flake8==3.3.0
idna==2.5                 # via requests

Unfortunately pypiup==0.0.2 fails to compare such kind of lines with the following result:

✗ appnope
  Could not compare. Invalid semver, From 0.1.0            # via ipython to 0.1.0.

✗ astroid
  Could not compare. Invalid semver, From 1.5.3            # via pylint to 1.5.3.

✗ certifi
  Could not compare. Invalid semver, From 2017.4.17        # via requests to 2017.4.17.

✗ chardet
  Could not compare. Invalid semver, From 3.0.3            # via requests to 3.0.4.

✗ click
  Could not compare. Invalid semver, From 6.7                # via pip-tools, pypiup to 6.7.

✗ decorator
  Could not compare. Invalid semver, From 4.0.11         # via ipython, traitlets to 4.0.11.

✗ first
  Could not compare. Invalid semver, From 2.0.1              # via pip-tools to 2.0.1.

✓ flake8
  Up to date, 3.3.0.

✗ idna
  Could not compare. Invalid semver, From 2.5                 # via requests to 2.5.

This PR fixes requirement version parsing making it possible to combine pypiup with pip-tools in the projects.

@codecov-io
Copy link

codecov-io commented Jun 12, 2017

Codecov Report

Merging #13 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #13   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files           4        4           
  Lines         123      123           
=======================================
  Hits          122      122           
  Misses          1        1
Impacted Files Coverage Δ
pypiup/requirement.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ca2cf8...0dd23a2. Read the comment docs.

@pavdmyt
Copy link
Contributor Author

pavdmyt commented Jul 6, 2017

@manosim Any chance we can get this merged, or a similar PR?

@manosim
Copy link
Owner

manosim commented Jul 6, 2017

Hello @pavdmyt! Both PRs look great thank you very much for sending them over! Can you add a test for this case as well (add a requirement with a comment in requirements-tests.txt)?

@pavdmyt
Copy link
Contributor Author

pavdmyt commented Jul 7, 2017

@manosim done.

@pavdmyt
Copy link
Contributor Author

pavdmyt commented Jul 19, 2017

Hey @manosim any updates, is it now Ok for merge?

@manosim
Copy link
Owner

manosim commented Jul 21, 2017

Hello @pavdmyt! Sorry was on holidays for the past three weeks! Just tested this one and it looks good! Thank you for opening this PR - really appreciate it! 😄

@manosim manosim merged commit 7810d38 into manosim:master Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants