-
-
Notifications
You must be signed in to change notification settings - Fork 28
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 support for constraints, install wheels before pyodide packages #181
Merged
ryanking13
merged 22 commits into
pyodide:main
from
bollwyvl:gh-175-constraints-wheels-first
Feb 1, 2025
Merged
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
48295ce
strawman api/docs changes for #175
bollwyvl 64bbbe8
update PR number
bollwyvl e50f58c
apply constraints in transaction
bollwyvl 57de68c
add minimal test
bollwyvl 7e4dde5
test set_constraints
bollwyvl dab4b42
add set_constraints
bollwyvl 5b5b1c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d5d2694
more tests
bollwyvl 03f6b0b
Merge remote-tracking branch 'origin/gh-175-constraints' into gh-175-…
bollwyvl c61f4ad
handle more emfs cases
bollwyvl 48340ed
address review comments
bollwyvl 6402421
update changelog
bollwyvl a6106d5
update docs
bollwyvl 98d1faa
handle env markers and additive constraints
bollwyvl c59c754
continue gathering requreiments from pyodide packages, reverse pydodi…
bollwyvl c47ee41
fix pr number in changelog
bollwyvl 32d3836
fix spelling
bollwyvl a1ff4e2
tighten up utils, docstrings
bollwyvl 7f88152
merge upstream
bollwyvl 92baa16
skip an await if not needed, rework changelog entry
bollwyvl d45f62d
Merge remote-tracking branch 'upstream/main' into gh-175-constraints-…
bollwyvl 00e6e7a
try more url checking
bollwyvl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Is there a user-facing change related to this? I think the order of installation is an implementation detail that is not visible to the user. What a user sees whether the whole set of packages (with dependencies) are installed or not.
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.
Yeah, I don't know: seems like In interactive package management, which can be modified by about five different flags now, I think "reversing what we used to do," warrants at least a note. I am not sure if it's breaking, but things folk did before might not work now, and they might not need workarounds (like the double-install thing).
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 see. Makes sense. Let me check the code more carefully and review.
I think the current wording could be a bit misleading to users though. When the same package exists in both the pyodide lock file and PyPI, the lockfile currently takes precedence (in terms of which package to choose, not the order of installation). This PR is not related to it, but maybe the user will think that this PR is changing that behavior.
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.
Right: today, in the transaction phase once a dependency chain hits a pyodide package, further dependency resolution was skipped because the lockfile would take care of the rest. This was a performance win, for sure. In the install stage, they were all mixed together in
wheel_tasks
, and there was really no way to make any claims about what would happen.With this change, the transaction will keep going all the way down for every novel dependency. In the install phase, the PyPI wheels get installed (in parallel) before calling
loadPackage
, which won't re-install (and re-download) a pyodide wheel.This does mean there will be an extra
add_dependency_inner
for eachdepends
item, but I couldn't figure out a way to do it that would be remotely correct.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.
... but that's a lot to say in a CHANGELOG, maybe there's a terser way?
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.
tried some more things on 92baa16
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.
Hmm, I still don't quite get what
which won't re-install
means. By default, during the dependency resolution step, micropip will check if the package is available in the lockfile, and select the one from the lockfile instead of the one from the PyPI.So, in the installation step, we expect no overlap between
transaction.pyodide_packages
andtransaction.wheels
. Does this PR change this behavior?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.
Note the download of two
pytest
wheels:After this PR, since the wheel would already be installed, it would look more like this:
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.
Got it. I didn't consider putting multiple packages in
install(...)
. Thanks.