All Questions
Tagged with bazel-python python
13 questions
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 ...
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 ...
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
| ├──...
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....
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:...
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 ...
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:
...
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 ...
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("@...
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 ...
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 ...
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
...
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 --...