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

Apply nanobind_bazel patch via git instead #53

Merged
merged 2 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v5
- name: Run pre-commit checks
run: uvx pre-commit run --all-files --verbose --show-diff-on-failure
test:
Expand All @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check out nanobind example repo
Expand All @@ -40,12 +40,9 @@ jobs:
repository: wjakob/nanobind_example
path: nanobind_example
ref: bazel
- name: Patch nanobind_example stubgen target
run: git apply ${{github.workspace }}/stubgen.patch
- name: Override nanobind_bazel dep with local checkout in MODULE.bazel
run: git apply ${{github.workspace }}/nanobind_bazel_local_override.patch
working-directory: ${{ github.workspace }}/nanobind_example

- name: Override nanobind_bazel pin in MODULE.bazel
run: python fixup_module_bazel.py ${{ github.workspace}}/nanobind_example
- name: Build and test nanobind_example on ${{ matrix.os }}
# --no-sync is required so that uv does not remove the .so file again.
run: |
Expand Down
37 changes: 0 additions & 37 deletions fixup_module_bazel.py

This file was deleted.

29 changes: 29 additions & 0 deletions nanobind_bazel_local_override.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/MODULE.bazel b/MODULE.bazel
index 7723d4c..a15a36b 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,6 +1,10 @@
module(name = "nanobind_example", version = "0.1.0")

-bazel_dep(name = "nanobind_bazel", version = "2.4.0")
+bazel_dep(name = "nanobind_bazel", version = "")
+local_path_override(
+ module_name = "nanobind_bazel",
+ path = "../",
+)
bazel_dep(name = "rules_python", version = "1.0.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
diff --git a/src/BUILD b/src/BUILD
index 5562dca..95e210e 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -20,6 +20,6 @@ nanobind_stubgen(
name = "nanobind_example_ext_stubgen",
module = ":nanobind_example_ext",
marker_file = "src/py.typed",
- output_directory = "src",
- recursive = True,
+# output_directory = "src",
+# recursive = True,
)
13 changes: 0 additions & 13 deletions stubgen.patch

This file was deleted.

Loading