forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repo: Use python toolchains (envoyproxy#20432)
Signed-off-by: Ryan Northey <ryan@synca.io>
- Loading branch information
Showing
4 changed files
with
43 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
load("@rules_python//python:pip.bzl", "pip_install", "pip_parse") | ||
load("@python3_10//:defs.bzl", "interpreter") | ||
|
||
def envoy_python_dependencies(): | ||
pip_parse( | ||
name = "base_pip3", | ||
python_interpreter_target = interpreter, | ||
requirements_lock = "@envoy//tools/base:requirements.txt", | ||
extra_pip_args = ["--require-hashes"], | ||
) | ||
|
||
# These need to use `pip_install` | ||
pip_install( | ||
# Note: dev requirements do *not* check hashes | ||
python_interpreter_target = interpreter, | ||
name = "dev_pip3", | ||
requirements = "@envoy//tools/dev:requirements.txt", | ||
) | ||
|
||
pip_install( | ||
name = "fuzzing_pip3", | ||
python_interpreter_target = interpreter, | ||
requirements = "@rules_fuzzing//fuzzing:requirements.txt", | ||
extra_pip_args = ["--require-hashes"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
load("@emsdk//:deps.bzl", emsdk_deps = "deps") | ||
load("@rules_python//python:pip.bzl", "pip_install", "pip_parse") | ||
load("@rules_python//python:repositories.bzl", "python_register_toolchains") | ||
load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime:crates.bzl", "wasmtime_fetch_remote_crates") | ||
load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates") | ||
|
||
# Python dependencies. | ||
def _python_deps(): | ||
pip_parse( | ||
name = "base_pip3", | ||
requirements_lock = "@envoy//tools/base:requirements.txt", | ||
extra_pip_args = ["--require-hashes"], | ||
) | ||
|
||
# These need to use `pip_install` | ||
pip_install( | ||
# Note: dev requirements do *not* check hashes | ||
name = "dev_pip3", | ||
requirements = "@envoy//tools/dev:requirements.txt", | ||
) | ||
pip_install( | ||
name = "fuzzing_pip3", | ||
requirements = "@rules_fuzzing//fuzzing:requirements.txt", | ||
extra_pip_args = ["--require-hashes"], | ||
) | ||
# Python version for `rules_python` | ||
PYTHON_VERSION = "3.10.2" | ||
|
||
# Envoy deps that rely on a first stage of dependency loading in envoy_dependencies(). | ||
def envoy_dependencies_extra(): | ||
_python_deps() | ||
def envoy_dependencies_extra(python_version = PYTHON_VERSION): | ||
emsdk_deps() | ||
raze_fetch_remote_crates() | ||
wasmtime_fetch_remote_crates() | ||
|
||
# Registers underscored Python minor version - eg `python3_10` | ||
python_register_toolchains( | ||
name = "python%s" % ("_".join(python_version.split(".")[:-1])), | ||
python_version = python_version, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters