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

Draft: Bazel recursive stubgen example #54

Open
wants to merge 6 commits into
base: bazel
Choose a base branch
from

Conversation

cemlyn007
Copy link

I made this branch mainly for another MR I am trying to merge with the help of @nicholasjng. If/when the nanobind-bazel MR can land, would you maintainers want this example merged as well?

It's meant to be a slight modification of the existing example to create an example sub-module and makes a small modification to the setup.py to copy files whilst preserving the module structure.

nicholasjng and others added 3 commits November 9, 2024 09:32
Provides a Bazel build configuration using bzlmod.

Currently, the required `nanobind_bazel` dep is sourced from a local
directory. This needs to be adjusted to either reflect the setup in CI,
or point to a `nanobind-bazel` tag on BCR once it's released.

Uses legacy setup.py / setuptools machinery since there's currently no
build backend support for Bazel available.

Builds a stable ABI wheel for CPython 3.12+ on all architectures.
@cemlyn007 cemlyn007 changed the base branch from master to bazel November 17, 2024 22:04
Copy link
Collaborator

@nicholasjng nicholasjng left a comment

Choose a reason for hiding this comment

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

Thanks for the addition! I think this is very valuable to have for nanobind-bazel.

I actually have write access to this repo, since I sometimes need to update the bazel branch when configurations change (or setuptools breaks again). If @wjakob agrees, I can take over all Bazel-related PRs on this repo.

src/nanobind_example/sub_ext/__init__.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
Provides a Bazel build configuration using bzlmod.

Currently, the required `nanobind_bazel` dep is sourced from a local
directory. This needs to be adjusted to either reflect the setup in CI,
or point to a `nanobind-bazel` tag on BCR once it's released.

Uses legacy setup.py / setuptools machinery since there's currently no
build backend support for Bazel available.

Builds a stable ABI wheel for CPython 3.12+ on all architectures.
@nicholasjng
Copy link
Collaborator

Hey @cemlyn007 , since rules_python just released v1.0.0 with a fix for the Windows library locations, I updated the setup.py (and some other files) accordingly to test if we can build nanobind on Windows with only a hermetic interpreter.

Could I ask you to rebase on current bazel? Then I'll merge this right after.

@wjakob
Copy link
Owner

wjakob commented Dec 9, 2024

If @wjakob agrees, I can take over all Bazel-related PRs on this repo.

I agree.

A tangent : would it make sense to advertise more broadly that there is a bazel branch on the master branch? This may not be obvious to visitors.

@nicholasjng
Copy link
Collaborator

Thanks! And sure, I can add a note to the readme or something similar.

@nicholasjng
Copy link
Collaborator

Note: I declared the dependency on nanobind_bazel to be against a stable release from BCR, since that is how most users will use the package. Instead of keeping the local_path_override in this repo, I will add it in nanobind-bazel CI.

Currently CI is all red, since we're passing arguments to stubgen that have not been implemented yet (PR is open already). Once nanobind-bazel v2.4.0 is out on the BCR, this will be fixed.

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.

3 participants