-
-
Notifications
You must be signed in to change notification settings - Fork 615
fix(local_runtime): Improve local_runtime usability in macos / windows #3148
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
laramiel
wants to merge
18
commits into
bazel-contrib:main
Choose a base branch
from
laramiel:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+328
−89
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
76926ac
fix(local_runtime): Improve local_runtime usability in macos / windows
laramiel b9cbc67
Correct _expand_incompatible_template
laramiel 965a6a9
Update changelog
laramiel 8b61915
Formatting + minor cleanups
laramiel 6ac66c9
format WORKSPACE
laramiel f4c0fed
Move the complex logic to resolve the python shared libraries from bz…
laramiel 9283a3f
Fix formatting and method docs
laramiel e8997c1
Better handle missing interface_library values. This can happen on m…
laramiel 655ea0f
Format local_runtime_repo_setup.bzl
laramiel e4eea87
reformat get_local_runtime_info.py and main.py
laramiel 87d5391
Update CHANGELOG and minor comments.
laramiel 09bfee9
Minor tweaks to library name genration
laramiel dda37d6
expand changelog description
rickeylev d7b2888
Merge branch 'main' into main
rickeylev 0df9bf1
name loop var, add non-uv libs finding comment
rickeylev 5874d5c
Distinguish between interface library and dynamic library file paths.
laramiel 7bafc72
Refine comments, a few other minor changes
laramiel 7c3428e
Update comment.
laramiel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# The equivalent bzlmod behavior is covered by examples/bzlmod/py_proto_library | ||
common --noenable_bzlmod | ||
common --enable_workspace | ||
common --incompatible_python_disallow_native_rules |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# git ignore patterns | ||
|
||
/bazel-* | ||
user.bazelrc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
load("@rules_python//python:py_binary.bzl", "py_binary") | ||
|
||
py_binary( | ||
name = "main", | ||
srcs = ["main.py"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
workspace( | ||
name = "local_python_example", | ||
) | ||
|
||
local_repository( | ||
name = "rules_python", | ||
path = "../..", | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories") | ||
|
||
py_repositories() | ||
|
||
load("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo", "local_runtime_toolchains_repo") | ||
|
||
# Step 1: Define the python runtime. | ||
local_runtime_repo( | ||
name = "local_python3", | ||
interpreter_path = "python3", | ||
on_failure = "fail", | ||
# or interpreter_path = "C:\\path\\to\\python.exe" | ||
) | ||
|
||
# Step 2: Create toolchains for the runtimes | ||
local_runtime_toolchains_repo( | ||
name = "local_toolchains", | ||
runtimes = ["local_python3"], | ||
) | ||
|
||
# Step 3: Register the toolchains | ||
register_toolchains("@local_toolchains//:all") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2025 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
def main(): | ||
print(42) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.