-
-
Notifications
You must be signed in to change notification settings - Fork 597
feat(pypi): pip.defaults API for customizing pipstar 1/n #2987
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
Conversation
Summary: - Allow switching to the Starlark implementation of the marker evaluation function. - Add a way for users to modify the `env` for the marker evaluation when parsing the requirements. This can only be done by `rules_python` or the root module. - Limit the platform selection when parsing the requirements files. Work towards bazel-contrib#2747 Work towards bazel-contrib#2949 Split out from bazel-contrib#2909
14c0ff9
to
cd4dd15
Compare
if not env: | ||
fail("Please define platform: '{}'".format(platform_str)) | ||
|
||
if evaluate(req.marker, env = env): |
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.
We evaluate during the bzlmod phase to basically pre-filter, right?
e.g if you have {"linux": "requirements_universal.txt"}
, then we're basically stripping out all the foo; os=="windows"
lines so that we don't bother traversing (in the index) anything for foo for linux, and also avoid generating any targets for foo (for linux, anyways)
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.
Correct.
Co-authored-by: Richard Levasseur <[email protected]>
WIP: stacked on #2987 This is adding `constraint_values` attribute to `pip.configure` and is threading it all the way down to the generation of `BUILD.bazel` file of for config settings used in the hub repository. Out of scope: - Passing `flag_values` or target settings. I am torn about it - doing it in this PR would flesh out the design more, but at the same time it might become harder to review. - `whl_target_platforms` and `select_whls` is still unchanged, not sure if it is related to this attribute addition. Work towards #2747 Work towards #2548 Work towards #260 --------- Co-authored-by: Richard Levasseur <[email protected]>
Parse env markers in pip.parse using starlark
Summary:
evaluation function.
env
for the marker evaluation whenparsing the requirements. This can only be done by
rules_python
orthe root module.
Work towards #2747
Work towards #2949
Split out from #2909