Skip to main content

All Questions

Tagged with
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 ...
kgully's user avatar
  • 682
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 ...
sdgfsdh's user avatar
  • 37.3k
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 | ├──...
Ran Silberman's user avatar
1 vote
2 answers
1k views

How to materialize Bazel Outputs

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

One entry point in WORKSPACE for managing various python project requirements

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
2 votes
0 answers
783 views

Code coverage for Python using Bazel 6.0.0

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
  • 8,210
0 votes
0 answers
133 views

NameError with extend_path using Bazel

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

Creating Python zip for AWS Lambda using Bazel

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

Bazel build file load multiple dependencies

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
  • 175
3 votes
1 answer
2k views

Add required dependencies to py_wheel

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

bazel logging inside of a BUILD file

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

How do I select the runtime in bazel for Python and pip?

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

How do you generate Python coverage in bazel?

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