-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODULE.bazel
38 lines (33 loc) · 1.46 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Name the workspace/module
module(
name = "bitwarden-to-keepass",
version = "0.0.0",
compatibility_level = 1,
)
# Install rules_python, which allows us to define how bazel should work with python files.
# See https://github.com/bazelbuild/rules_python/blob/c6941a8dad4c7a221125fbad7c8bfaac377e00ba/examples/bzlmod/MODULE.bazel
bazel_dep(name = "rules_python", version = "0.31.0")
# Init the python toolchain using the extension.
# This is similar to the "python_register_toolchains" function in WORKSPACE.
# It creates a hermetic python rather than relying on a system-installed interpreter.
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
# Available versions are listed in @rules_python//python:versions.bzl.
# For some reason we can't set 3.8.18 here - it causes pip.parse() to fail.
python_version = "3.8"
)
# Enable pip
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
# Configure how we fetch python dependencies via pip
pip.parse(
# This name is what gets used in other BUILD files with `load()`.
hub_name = "pypi",
python_version = "3.8.18",
# TODO: what to put here? Using this might resolve the "can't set 3.8.18"
# issue mentioned above.
# python_interpreter_target = python,
requirements_lock = "//:requirements_lock.txt",
)
# Same as WORKSPACE install_deps() - actually install the python deps.
use_repo(pip, "pypi")