Skip to content

fix: Fix bazel vendor support for requirements with environment markers #2997

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
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

armandomontanez
Copy link
Contributor

Fixes bazel vendor support for requirements files that contain environment markers. During a vendored bazel build, when evaluate_markers_py() is run it needs PYTHONHOME set to properly find the home of the vendored libraries.

Resolves (#2996)

Fixes `bazel vendor` support for requirements files that contain
environment markers. During a vendored `bazel build`, when
evaluate_markers_py() is run it needs PYTHONHOME set to properly find
the home of the vendored libraries.

Resolves (bazel-contrib#2996)
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

To make it possible to merge this it would be great if you could add a changelog note.

Any reason why you are using pip_parse instead of bzlmod example? It already is using the env markers.

@@ -95,6 +97,7 @@ def evaluate_markers_py(mrctx, *, requirements, python_interpreter, python_inter
Label("@pypi__packaging//:BUILD.bazel"),
Label("//:BUILD.bazel"),
],
"PYTHONHOME": str(interpreter.dirname),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Solution LGTM in general.

@armandomontanez
Copy link
Contributor Author

To make it possible to merge this it would be great if you could add a changelog note.

Done.

Any reason why you are using pip_parse instead of bzlmod example? It already is using the env markers.

Ah, didn't realize that. Verified the bzlmod example reproduces the issue, and switched to just use that as the CI check.

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