Skip to content

feat: provide access to arbitrary interpreters #2507

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

Merged
merged 42 commits into from
Feb 16, 2025

Conversation

philsc
Copy link
Contributor

@philsc philsc commented Dec 16, 2024

There are some use cases that folks want to cover here. They are
discussed in this Slack thread. The high-level summary is:

  1. Users want to run the exact same interpreter that Bazel is running
    to minimize environmental issues.
  2. It is useful to pass a target label to third-party tools like mypy
    so that they can use the correct interpreter.

This patch adds to @rickeylev's work from #2359 by adding docs
and a few integration tests.

rickeylev and others added 10 commits October 29, 2024 21:05
Run a specific interpreter:
* `bazel run @rules_python//tools/run --@rules_python//python/config_settings:python_version=3.12`

Run interpreter from a binary:
* `bazel run @rules_python//tools/run --@rules_python//tools/run:bin=//my:binary`
    $ bazel run //python/bin:repl
    $ bazel run //python/bin:repl --//python/bin:repl_dep=//python/runfiles
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.

I know this is still a draft, so take my suggestions with a grain of salt :)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@philsc philsc requested a review from aignas February 10, 2025 00:34
@rickeylev
Copy link
Collaborator

Implementation wise, I think this looks good. Just the cleanup as discussed needed

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
primeos Michael Weiss

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
@philsc
Copy link
Contributor Author

philsc commented Feb 16, 2025

I don't think the changes here are causing the mypy failure 🤔

@philsc philsc requested a review from aignas February 16, 2025 19:24
@rickeylev
Copy link
Collaborator

re: mypy failures: Yeah, its unrelated. It started failing a couple days ago, but nobody has yet looked into why.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rickeylev rickeylev enabled auto-merge February 16, 2025 21:21
@rickeylev rickeylev added this pull request to the merge queue Feb 16, 2025
Merged via the queue into bazel-contrib:main with commit 34e82cd Feb 16, 2025
3 of 4 checks passed
@rickeylev
Copy link
Collaborator

Ah, I got a bit excited and merged this a bit soon -- CHANGELOG.md updates are missing

github-merge-queue bot pushed a commit that referenced this pull request Feb 17, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This was a forgotten part of the original PR (#2507) implementing it.
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.

None yet

3 participants