37 questions
0
votes
1
answer
57
views
What characters are allowed in the file name (Focus equal '=')?
I want to pass a folder as a dependency for a py_test in Bazel. This contains file names with the special character '=', such as 'equal=.txt'. I receive a terminal print that the file could not be ...
2
votes
1
answer
100
views
bazel build and run grpc server with python
I am trying to setup a larger bazel infrastructure to
Create .py files from a .proto file for gRPC using rules_proto_grpc_python
Run the server code that implements the interfaces defined in 1 via a ...
1
vote
0
answers
60
views
How to integrate VSCode debugger for Python Bazel projects without altering source code?
I have a monorepo project built with Bazel and I'm trying to integrate VSCode debuggers directly with Python targets I'm running.
There is a similar question that helps solve the problem here: How to ...
0
votes
0
answers
35
views
Bazel python interpreter commandline flags
How to make a py_binary target that accepts interpreter flags such as -OO and -W?
I want the bazel_binary to create an executable that runs python -OO -W main.py.
py_binary(
name="main",
...
0
votes
0
answers
41
views
Custom py_binary bazel target that uses deepspeed instead of python3 toolchain
In order to use deepspeed, I need to use the cli to run deepspeed main.py instead of python3 main.py. My goal is to create a deepspeed_py_binary target that is 99% the same as py_binary except it uses ...
0
votes
1
answer
74
views
How do I include a cmake target as a dependency in a py_library target? (tiny-cuda-nn)
I'm trying to wrap tiny-cuda-nn with bazel to include as a dependency for other projects. This is a cmake project, but it has bindings for Python. The conventional way to install this would be with a ...
1
vote
0
answers
343
views
Build a docker image for Python with Bazel Docker OCI
I’m working on a project that involves building Docker images using Python. I came across an example that uses the py_oci_image rule to construct an OCI image. Unfortunately, the example relies on ...
0
votes
1
answer
58
views
Different Python versions for different Bazel targets?
I have many py_library, py_binary and py_test targets.
Some of these must run against 3.9.16 (constraint outside of my control) and others use 3.10.6 (in order to get more recent features).
In my ...
0
votes
1
answer
303
views
How do I provide a py_binary's runfiles to a C toolchain in Bazel
I am trying to write a compiler, well, a Python wrapper for Clang that does some platform specific stuff in Bazel. I have created a MRE where I can reproduce my problem here: https://github.com/...
1
vote
1
answer
230
views
Issue Running Python Application with Bazel - ImportError with NumPy C-Extensions
I have a Python project which I am building and running with Bazel. The project includes dependencies such as flask, transformers, and numpy. When I attempt to run my application using Bazel, I ...
1
vote
0
answers
164
views
is there a way to run bazel tests in required sequence?
how to enforce bazel test targets to run in specific order on CI builds? because test results of one depends on another tetss results?
I have four targets init,up,down,rm and I want to run the tests ...
0
votes
0
answers
898
views
How to use an installed requirement in bazel BUILD file?
I am creating a new bazel workspace for a python codebase. The codebase has multiple folders with respective BUILD files. Each of the BUILD file has different external dependencies. These external ...
5
votes
2
answers
1k
views
Bazel cross platform build fails with "Unable to find a CC toolchain using toolchain resolution."
I have a python binary that I build with bazel on Mac. Now, I want to create the binary for linux for deployment.
I am following this instruction.
I added
platform(
name = "linux_x86",
...
2
votes
1
answer
916
views
binary file not found when running bazel oci_image on local docker
I have a bazel project (monorepo), that has some go and python code. I use bazel for building. For each of these, I want to create separate container. For creating python image, I am following this ...
2
votes
1
answer
158
views
Bazel - How to create Deps for a Rule from dynamic list of targest directories
I want to create deps in a rule in Bazel that will be dynamic and not hardcoded, from a list of directories.
Here is the file structure:
| //plugins_folder
├── code0.py
├── BUILD
├── plugin1
| ├──...