Skip to content
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

[build] Remove python venv_bin filegroup #22355

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Dec 27, 2024

Towards #22346 and #20731.


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: medium release notes: none This pull request should not be mentioned in the release notes labels Dec 27, 2024
@jwnimmer-tri jwnimmer-tri force-pushed the repo-python-rm-jupyter-pants-test branch from 3cb2343 to ec7896b Compare December 28, 2024 16:37
@jwnimmer-tri jwnimmer-tri changed the title [build] Remove troublesome jupyter regression test [build] Remove python venv_bin filegroup Dec 28, 2024
@jwnimmer-tri jwnimmer-tri force-pushed the repo-python-rm-jupyter-pants-test branch 2 times, most recently from a00a497 to 95ed8f8 Compare December 28, 2024 16:56
The filegroup unnecessarily couples our BUILD files to our repository
rule, without the py_toolchain as an intermediary. Our goal is to use
the toolchain to fully encapsulate the selected python interpreter.

Previously the venv_bin had only two citations:

(1) Jupyter executable lookup from a jupyter regression test.

The test had no need for a subprocess; the production code that
it's guarding (jupyter_bazel) imports jupyter from sys.path, it
doesn't shell out. We rework the test to better match what it's
guarding, and therefore can drop the venv_bin dependency.

(2) Python interpreter lookup from installer regression test.

The sys.executable used for testing already points to the venv python.
The Rlocation lookup was vestigial, from an earlier draft that added
the venv libraries with deps instead of with the toolchain.
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

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

+@mwoehlke-kitware for feature review, please.

Reviewed 7 of 7 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee mwoehlke-kitware, needs platform reviewer assigned, needs at least two assigned reviewers


a discussion (no related file):
Working

Once macOS CI is up and running again, we'll need to confirm that this passes on macOS CI before merging.

Copy link
Contributor

@mwoehlke-kitware mwoehlke-kitware left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 7 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee mwoehlke-kitware, needs platform reviewer assigned, needs at least two assigned reviewers


tools/workspace/python/repository.bzl line 128 at r2 (raw file):

    os_name = repo_ctx.os.name  # "linux" or "mac os x"
    if os_name != "mac os x":
        execute_or_fail(repo_ctx, ["mkdir", "bin"])

Shouldn't there be a corresponding change in venv_sync?

Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, LGTM missing from assignee mwoehlke-kitware, needs platform reviewer assigned, needs at least two assigned reviewers


a discussion (no related file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

Working

Once macOS CI is up and running again, we'll need to confirm that this passes on macOS CI before merging.

Done.


tools/workspace/python/repository.bzl line 128 at r2 (raw file):

Previously, mwoehlke-kitware (Matthew Woehlke) wrote…

Shouldn't there be a corresponding change in venv_sync?

I don't see any problem. Can you elaborate?

As I understand it, creating the empty bin directory here was only necessary to satisfy the now-deleted glob() in package.BUILD.bazel.

Below, we still return repo_ctx.path("bin/python3") as PYTHON_BIN_PATH.

@mwoehlke-kitware
Copy link
Contributor

tools/workspace/python/repository.bzl line 128 at r2 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

I don't see any problem. Can you elaborate?

As I understand it, creating the empty bin directory here was only necessary to satisfy the now-deleted glob() in package.BUILD.bazel.

Below, we still return repo_ctx.path("bin/python3") as PYTHON_BIN_PATH.

Ah, right, I forgot about that...

Copy link
Contributor

@mwoehlke-kitware mwoehlke-kitware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: needs platform reviewer assigned, needs at least two assigned reviewers

@jwnimmer-tri
Copy link
Collaborator Author

+@SeanCurtis-TRI for platform review per schedule, please.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

:LGTM:

Reviewed 6 of 7 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees SeanCurtis-TRI(platform),mwoehlke-kitware

@SeanCurtis-TRI SeanCurtis-TRI merged commit 1d3f114 into RobotLocomotion:master Jan 2, 2025
10 checks passed
@jwnimmer-tri jwnimmer-tri deleted the repo-python-rm-jupyter-pants-test branch January 2, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium release notes: none This pull request should not be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants