-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Add a test for uncovered branch in the writer module #1101
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1101 +/- ##
=======================================
Coverage 99.42% 99.43%
=======================================
Files 34 34
Lines 2441 2458 +17
Branches 302 302
=======================================
+ Hits 2427 2444 +17
Misses 8 8
Partials 6 6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look to understand the cases covered or not, and figured out that this change would result in a false-positive warning in the case that:
--generate-hashes
is passed, and- only editable requirements are present
The editable requirements don't (can't) get hashed, and if there were also hashed reqs then pip
would refuse to cooperate, but since none of them are, the results are no different from not passing --generate-hashes
, so pip
will have no problem.
It may be the case that a warning is still appropriate, if unnecessary, since hashes were requested, but the current language says "pip install will require the following package to be hashed," which isn't true in this case.
Reproduction (using plumbum
since it has no deps):
$ git clone git@github.com:tomerfiliba/plumbum
$ cd plumbum
$ echo '-e .' > requirements.in
$ pip-compile --no-header --generate-hashes requirements.in
# WARNING: pip install will require the following package to be hashed.
# Consider using a hashable URL like https://github.com/jazzband/pip-tools/archive/SOMECOMMIT.zip
-e file:///home/andy/Code/plumbum # via -r requirements.in
The generated requirements file may be rejected by pip install. See # WARNING lines for details.
@AndydeCleyre awesome catch! 🎉 That's so tricky. I'll add a test for that case then. |
7ba55c1
to
ce125e0
Compare
The test looks good 👍 . Is it still the plan to change the EDIT: If it's the latter, please just update the PR title. |
Title updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks!
Thank you for the analysis and for reviewing this! |
There was uncovered unnecessary branch.Now it's 100% coverage in the writer module.