Repository navigation
Conversation
Add pip.parse(pylock = ...), which reads a pylock.toml (PEP 751) file into the lock model. All of the listed extras and dependency groups are selected and a package is used on the platforms where its marker and requires-python are true, the dependency graph is not used as the standard requires. The top-level requires-python has to match the platforms and the platforms that do not match the environments are ignored. The vcs, archive and directory sources are left for later. Work towards bazel-contrib#2787.
Also only use the platforms that match the lock file when exposing the packages, fail for a package whose requires-python does not match a platform where it is needed, without a version or when the pylock is used with the other lock files and warn about the files without a URL.
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
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.
pylock.toml(PEP 751) is the standard lock file format thatuv,pdm,pip lockandpoetry-plugin-exportcan write, butpip.parseonly readsrequirements.txtfiles anduv.lock. rules_pycross reads it, and it is theway to consume
pdm.lockandpoetry.lockfiles.This adds
pip.parse(pylock = ...), which translates the lock file into thelock model that the uv.lock support uses:
extras,default-groupsanddependency-groupsare selected,so that the hub has all of the packages;
pip.configurelimits which ofthem are exposed.
markeris true; thedependency graph is not used, as the standard requires. Its
requires-pythonhas to match those platforms.requires-pythonhas to match the platforms; the platformsthat do not match the
environmentsare ignored with a warning.indexbecomes the index URL of the package, the strongest of thehashesis used andlocal_wheelswork like withuv.lock.The
vcs,archiveanddirectorysources fail for now and are left for afollow-up.
pep508_evaluatesupport for theextrasanddependency_groupsmarkers comes from #4.
Work towards bazel-contrib#2787.
Stack (fork test PRs): on top of #10.