Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

I'm new to Bazel Python, so trying to follow the examples in https://github.com/aspect-build/bazel-examples/tree/main/oci_python_image. The oci_python_image example builds and runs well without any ...
Bobokaris's user avatar
0 votes
1 answer
96 views

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 ...
Gelsengamer's user avatar
2 votes
1 answer
229 views

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 ...
kgully's user avatar
  • 682
1 vote
0 answers
125 views

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 ...
Michael Becker's user avatar
0 votes
0 answers
54 views

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", ...
Jack Shi's user avatar
0 votes
1 answer
91 views

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 ...
Chuck's user avatar
  • 2,122
1 vote
0 answers
430 views

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 ...
Modi's user avatar
  • 2,385
0 votes
1 answer
153 views

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 ...
sdgfsdh's user avatar
  • 37.8k
0 votes
1 answer
418 views

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/...
mallwright's user avatar
  • 2,023
1 vote
1 answer
314 views

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 ...
ModiCnvrg's user avatar
1 vote
0 answers
208 views

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 ...
Sivakumar's user avatar
0 votes
0 answers
1k views

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 ...
Nisha Tiwari's user avatar
6 votes
2 answers
2k views

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", ...
JackDaniels's user avatar
  • 1,090
2 votes
1 answer
1k views

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 ...
JackDaniels's user avatar
  • 1,090
2 votes
1 answer
209 views

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 | ├──...
Ran Silberman's user avatar
0 votes
1 answer
38 views

I have a python project with unit tests (unittest module) organized like this: ./WORKSPACE ./test/topic_a/BUILD ./test/topic_a/class_name_a_test.py ./test/topic_b/BUILD ./test/topic_b/...
gph's user avatar
  • 1,361
0 votes
1 answer
354 views

I'm trying to add a custom build rule that will automatically add all the targets (python files) in each sub-folder to the dependencies for a py_binary in a BUILD file. Here is the folder structure of ...
Dora Radovan's user avatar
2 votes
1 answer
237 views

I encountered an issue with the proto rules provided by rules_python. I believe adding protos that utilizes py_proto_library will overshadow the "google" module, making relevant PIP ...
Chuan Ye's user avatar
1 vote
0 answers
453 views

I tried to setup a grpc Python server using Bazel. On my Mac machine, if I load the grpc rules first before the proto rules, I can build and run the binary just fine. However, if I load the proto ...
Chuan Ye's user avatar
1 vote
2 answers
1k views

I am relatively new to bazel, so this is probably a relatively simple question. I have a bunch of libraries defined in my build structure. Something like this: /libraries - /lib1 - BUILD - files....
felixnext's user avatar
1 vote
1 answer
1k views

My Bazel project structure is like this ├── BUILD ├── WORKSPACE ├── example.py ├── reqs.bzl └── requirements.txt I have created my WORKSPACE like this load("@bazel_tools//tools/build_defs/repo:...
a k's user avatar
  • 561
3 votes
1 answer
3k views

Trying to build a set up Python package dependencies with rules_python per these instructions but when running bazel build I get this error: ERROR: error loading package under directory '': error ...
tomocafe's user avatar
  • 1,594
1 vote
1 answer
421 views

I have a Python script named blob_to_cpp.py (located at scirpts/blob_to_cpp.py relative to the WORKSPACE.bazel file). The Python script takes an input file (e.g. weights/rt_alb.tza) and generates from ...
Vertexwahn's user avatar
  • 7,879
2 votes
0 answers
825 views

I want to generate a code coverage report using Bazel for a Python project (my environment: macOS Ventura, M1 arm64, Python 3.10, Bazel 6.0). The documentation states that for this task Bazel 6.0 and ...
Vertexwahn's user avatar
  • 7,879
0 votes
2 answers
1k views

I am writing a Bazel macro for uploading python wheels to PyPI. In order to upload the .whl file to PyPI, I'm calling twine as the last step of my macro. Twine is a python package, and it looks like ...
Ibolit's user avatar
  • 9,790
3 votes
0 answers
2k views

I use Python Rules for Bazel to build my python projects. I use pip_parse to install pip packages, as described in the guide, but that doesn't seem to be working for packages with extras. For example, ...
andrii's user avatar
  • 1,398
0 votes
1 answer
210 views

I am trying to move a large project to using Bazel, and I am starting small. I have found a small wrapper around pydantic in our project, and I am trying to "bazelify" that first. The ...
Ibolit's user avatar
  • 9,790
0 votes
0 answers
227 views

I am getting started with Bazel, and I am looking towards a Python monorepo. I would like to have, say, a subtree with "projects", that is something that can be deployed or run, and a ...
Ibolit's user avatar
  • 9,790
2 votes
0 answers
164 views

I am getting to know Bazel, and I would like to be able to test the same codebase against several python versions, mostly for the purposes of safe transition to a new one. I'm using ...
Ibolit's user avatar
  • 9,790
0 votes
0 answers
134 views

I am trying to make a python program using bazel. When running the following snippet of code: __path__ = __import__('pkgutil').extend_path(__path__, __name__) I am given the following error: ...
yoschi-solren's user avatar
5 votes
2 answers
2k views

I've a monorepo that contains a set of Python AWS lambdas and I'm using Bazel for building and packaging the lambdas. I'm now trying to use Bazel to create a zip file that follows the expected AWS ...
Ricardo Fonseca's user avatar
2 votes
1 answer
3k views

I have a Python repo that contains two requirement files. In my WORKSPACE file, I imported both the dependencies. requirements-1.txt: numpy requirements-2.txt: scipy WORKSPACE: load("@...
Isaac's user avatar
  • 167
0 votes
2 answers
1k views

I recently started working with bazel so admittedly, have little knowledge of bazel intricacies. I'm using bazel to generate docker images but I want to use multiple deps inside the py3_image rule. I ...
shiv's user avatar
  • 177
3 votes
1 answer
2k views

I am trying to create a wheel package from bazel using py_wheel. py_wheel has an option to provide the required python dependencies using the requires param. However, I don't want to provide the list ...
randomperson's user avatar
0 votes
2 answers
9k views

Hi I want to see what is being passed to a rule that is defined in a rules.bzl file. So I would like to add just a logging statement inside of either the BUILD file or the rules.bzl file just to see ...
uh_big_mike_boi's user avatar
5 votes
3 answers
10k views

I'm trying to build an app on Ubuntu 20.04, where python3 points to Python3.8, and I'm building aganist Python3.6 I have the following runtime in the same directory of WORKSPACE. $ cat BUILD.bazel ...
Ahmed's user avatar
  • 3,012
4 votes
1 answer
1k views

I'm trying to generate Python coverage in bazel. I tried to run this command and an empty file was generated $ bazelisk coverage //company/libs:foo_test INFO: Using default value for --...
Ahmed's user avatar
  • 3,012