cbc358ff0b
You can then do './scripts/python -m venv /path/to/venv' to create a virtual env based on the bundled Python, which can be handy if you don't happen to have the appropriate version of Python installed separately.
49 lines
794 B
Python
49 lines
794 B
Python
load("@rules_python//python:defs.bzl", "py_binary")
|
|
load("@py_deps//:requirements.bzl", "requirement")
|
|
load(":binary.bzl", "pip_binary")
|
|
|
|
# e.g. bazel run python
|
|
alias(
|
|
name = "python",
|
|
actual = "@python//:python",
|
|
)
|
|
|
|
# e.g. bazel run python:pip
|
|
pip_binary(name = "pip")
|
|
|
|
pip_binary(name = "black")
|
|
|
|
pip_binary(name = "isort")
|
|
|
|
pip_binary(name = "mypy")
|
|
|
|
pip_binary(
|
|
name = "dmypy",
|
|
pkg = "mypy",
|
|
)
|
|
|
|
pip_binary(name = "pylint")
|
|
|
|
pip_binary(
|
|
name = "protoc-gen-mypy",
|
|
pkg = "mypy-protobuf",
|
|
)
|
|
|
|
py_binary(
|
|
name = "update",
|
|
srcs = ["update.py"],
|
|
data = [
|
|
"requirements.in",
|
|
"requirements.txt",
|
|
],
|
|
tags = ["manual"],
|
|
deps = [
|
|
requirement("pip-tools"),
|
|
],
|
|
)
|
|
|
|
exports_files([
|
|
"requirements.txt",
|
|
"licenses.json",
|
|
])
|