I’m trying to set up a build for a Python project in Bazel.
One of the dependencies (nvdiffrast, to be exact) is a Python package, that is not in PyPi.
I usually install it directly from Git (pip install git+…). Now I don’t know how to set up installing this package in thenBazel build.
I’m trying something like:
http_archive(
name = "nvdiffrast",
url = "https://github.com/NVlabs/nvdiffrast/archive/refs/tags/v0.3.1.tar.gz",
integrity = ...,
strip_prefix = ...,
)
However, it’s still unclear to me how I would set up building this from setup.py (that is available in the repo).
You shouldn’t need to ‘install’ it. Check out the rules_python
docs. You’ll probably want to use a pip_parse
call to create a bazel-ified requirements file for the dependencies. Then, you can reference the packages with the same label syntax as other packages in Bazel.