-
Notifications
You must be signed in to change notification settings - Fork 616
fix: Support platform requirements in generated requirements files #2302
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
Open
danfairs
wants to merge
15
commits into
replicate:main
Choose a base branch
from
condensereality:2078-platform-requirements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: Support platform requirements in generated requirements files #2302
danfairs
wants to merge
15
commits into
replicate:main
from
condensereality:2078-platform-requirements
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Unfortunately the presence of a single hash triggers the strict —require-hashes mode, which may break a lot of builds if users are unprepared for this. Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
Signed-off-by: Dan Fairs <dan@condensereality.com>
@allcontributors please add @danfairs for code |
I've put up a pull request to add @danfairs! 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows environment markers from user requirements files to be propagated into the generated output requirements file.
It also lays the foundation for future support of
--hash
. These are currently removed, since their presence triggers the--require 10000 -hashes
mode, and that would break existing builds.This looks a fairly chunky PR, because we refactor the requirements processor to use a new
PythonRequirement
struct to capture everything we need to know about a requirement, rather than manipulating strings directly. This has allowed the generation of the requirements file itself to be separated from the version handling logic. I have also added a lot more tests.I have taken care to maintain the ordering of requirements in the output, so that they continue to reflect the user's own requirements file (not to mention the test cases!). This bookkeeping adds a small amount of extra complexity.
While this change passes all tests, and my own image now builds, it would benefit from testing on others' images.
For example, I have a requirements.txt file - an extract of which looks like this:
Here's the build output with
--debug
set. Note that both the platform requirements are preserved for thepywin32
package (and others), and the hashes are omitted:This fixes #2078.
If there are any standards/expectations around individual commits, let me know. I'm used to squash-and-merge, and this PR might be a bit messy if you just use merge commits.