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

Compile editables that are both primary reqs and constraints #1093

Merged
merged 1 commit into from
Apr 2, 2020

Conversation

richafrank
Copy link
Contributor

@richafrank richafrank commented Mar 28, 2020

If an editable package is both a primary requirement and a constraint, it was being considered as solely a constraint, and so it and its dependencies were excluded from pip-compile output.

Instead of combining the editable requirements, we were returning the first one, and the two are sorted the same up to "... -c constraints.in" and "... -r requirements.in".

Changelog-friendly one-liner: Ensure editables that are both primary reqs and constraints appear in pip-compile output

Contributor checklist
  • Provided the tests for the changes.
  • Gave a clear one-line description in the PR (that the maintainers can add to CHANGELOG.md on release).
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@richafrank richafrank marked this pull request as ready for review March 28, 2020 17:24
@codecov
Copy link

codecov bot commented Mar 28, 2020

Codecov Report

Merging #1093 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1093      +/-   ##
==========================================
- Coverage   99.42%   99.38%   -0.04%     
==========================================
  Files          34       34              
  Lines        2443     2452       +9     
  Branches      302      301       -1     
==========================================
+ Hits         2429     2437       +8     
  Misses          8        8              
- Partials        6        7       +1     
Impacted Files Coverage Δ
piptools/resolver.py 100.00% <100.00%> (ø)
tests/test_cli_compile.py 100.00% <100.00%> (ø)
piptools/repositories/pypi.py 93.14% <0.00%> (-0.58%) ⬇️

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 692f6be...b677a52. Read the comment docs.

@atugushev
Copy link
Member

Hello @richafrank!

If an editable package is both a primary requirement and a constraint, it was being considered as solely a constraint, and so it and its dependencies were excluded from pip-compile output.

It looks like a bug. Could you please provide also reproducible steps to test?

@richafrank
Copy link
Contributor Author

Hi @atugushev !

(I thought the unit test might serve as those steps. It fails on master.)

Put an editable in your requirements.in and the same one in a constraints via a second .in file. I can spell that out more precisely if that'd be helpful!

@atugushev
Copy link
Member

Usually, editables don't suppose to be in constraints file, but it looks like this bug related to layered workflow. Am I right?

piptools/resolver.py Outdated Show resolved Hide resolved
@richafrank
Copy link
Contributor Author

Usually, editables don't suppose to be in constraints file, but it looks like this bug related to layered workflow. Am I right?

Yea, I'm generating a lockfile from a base set of requirements. Then I'm using that lockfile as constraints when generating a lockfile for a superset of the base requirements, to keep them in sync. The base requirements include an editable package, so it appears in the lockfile. Thoughts on this workflow?

Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've finally had a chance to review it deeply. See me comments below:

piptools/resolver.py Outdated Show resolved Hide resolved
piptools/resolver.py Show resolved Hide resolved
piptools/resolver.py Outdated Show resolved Hide resolved
@atugushev atugushev added this to the 5.0.0 milestone Mar 31, 2020
@richafrank
Copy link
Contributor Author

Thanks for the review @atugushev . I'm certainly on board with your suggestions - I'm glad we don't need all that ordering compat.

Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@atugushev atugushev merged commit 175ed22 into jazzband:master Apr 2, 2020
@atugushev
Copy link
Member

Thanks, @richafrank!

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.

2 participants