Questions tagged [bazel-python]
24 questions
0
votes
1 answer
Bazel: install a python dependency for a genrule
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 it should be installed separately. However, I want…

Ibolit
- 9,218
- 7
- 52
- 96
0
votes
0 answers
Bazel Python binary fial becuse not space left on /tmp
My Python Bazel binaries fail because there is no space left in my /tmp folder.
Unfortunately, the /tmp on my machine is mounted on a disk with very limited capacity, and for other reasons, I can not mount it on a larger disk.
--output_base is…

iampat
- 1,072
- 1
- 12
- 23
0
votes
1 answer
Bazel, python: moving tests breaks imports in a pip_requirement
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 initial structure of the package was something like…

Ibolit
- 9,218
- 7
- 52
- 96
0
votes
0 answers
Toolchains with Bazel 0.5.4
Is there an import of rules_python that defines toolchains but is compatible with bazel release 0.5.4? If not, what's the minimum version of bazel that does implement toolchains?
$bazel info release
release 0.5.4
I've inherited an application that…

Val H
- 507
- 4
- 13
0
votes
0 answers
Python3 with Bazel 0.5.4 - hard-coded to python executable?
I'm maintaining a project that is using Bazel 0.5.4, and it needs to run on an environment where python does not exist. I'd like to point the application to using python3.
This issue is similar to Bazel 0.26.1 use Python3 on py_test, but the version…

Val H
- 507
- 4
- 13
0
votes
0 answers
Nested Python libraries
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 subtree with libraries. In that libraries subtree I would like to…

Ibolit
- 9,218
- 7
- 52
- 96
0
votes
0 answers
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:
NameError: name '__path__' is not defined
0
votes
2 answers
How to load multiple dependencies in py3_image bazel rule
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 have a BUILD.bazel which has python rule as…

shiv
- 165
- 1
- 20
0
votes
2 answers
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 what parameter was passed. I realize there is a…

uh_big_mike_boi
- 3,350
- 4
- 33
- 64