2024-07-27 06:49:29 +00:00
|
|
|
From 07af89ac82e0c5876590f89284795bffa4b0e1c8 Mon Sep 17 00:00:00 2001
|
2024-04-26 17:01:46 +00:00
|
|
|
From: Paul Meyer <49727155+katexochen@users.noreply.github.com>
|
|
|
|
Date: Mon, 22 Apr 2024 11:52:59 +0200
|
2024-07-27 06:49:29 +00:00
|
|
|
Subject: [PATCH 1/3] nixpkgs: use system Python
|
2023-02-19 20:43:05 +00:00
|
|
|
|
2024-04-26 17:01:46 +00:00
|
|
|
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
|
2023-02-19 20:43:05 +00:00
|
|
|
---
|
2023-10-19 13:55:26 +00:00
|
|
|
bazel/python_dependencies.bzl | 11 ++++-------
|
2024-04-26 17:01:46 +00:00
|
|
|
bazel/repositories_extra.bzl | 17 +----------------
|
|
|
|
2 files changed, 5 insertions(+), 23 deletions(-)
|
2023-02-19 20:43:05 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
diff --git a/bazel/python_dependencies.bzl b/bazel/python_dependencies.bzl
|
2024-07-27 06:49:29 +00:00
|
|
|
index b015e851c0..53a2c93c59 100644
|
2022-09-09 14:08:57 +00:00
|
|
|
--- a/bazel/python_dependencies.bzl
|
|
|
|
+++ b/bazel/python_dependencies.bzl
|
2024-07-27 06:49:29 +00:00
|
|
|
@@ -1,28 +1,25 @@
|
|
|
|
load("@com_google_protobuf//bazel:system_python.bzl", "system_python")
|
2023-10-19 13:55:26 +00:00
|
|
|
-load("@envoy_toolshed//:packages.bzl", "load_packages")
|
2024-04-26 17:01:46 +00:00
|
|
|
-load("@python3_11//:defs.bzl", "interpreter")
|
|
|
|
load("@rules_python//python:pip.bzl", "pip_parse")
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
def envoy_python_dependencies():
|
2023-10-19 13:55:26 +00:00
|
|
|
- # TODO(phlax): rename base_pip3 -> pip3 and remove this
|
|
|
|
- load_packages()
|
|
|
|
+ pip_parse(
|
|
|
|
+ name = "pip3",
|
|
|
|
+ requirements_lock = "@envoy_toolshed//:requirements.txt",
|
|
|
|
+ )
|
2022-09-09 14:08:57 +00:00
|
|
|
pip_parse(
|
|
|
|
name = "base_pip3",
|
|
|
|
- python_interpreter_target = interpreter,
|
|
|
|
requirements_lock = "@envoy//tools/base:requirements.txt",
|
|
|
|
extra_pip_args = ["--require-hashes"],
|
|
|
|
)
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
pip_parse(
|
2022-09-09 14:08:57 +00:00
|
|
|
name = "dev_pip3",
|
2023-05-24 13:37:59 +00:00
|
|
|
- python_interpreter_target = interpreter,
|
|
|
|
requirements_lock = "@envoy//tools/dev:requirements.txt",
|
|
|
|
extra_pip_args = ["--require-hashes"],
|
2022-09-09 14:08:57 +00:00
|
|
|
)
|
|
|
|
|
2023-02-19 20:43:05 +00:00
|
|
|
pip_parse(
|
2022-09-09 14:08:57 +00:00
|
|
|
name = "fuzzing_pip3",
|
|
|
|
- python_interpreter_target = interpreter,
|
2023-02-19 20:43:05 +00:00
|
|
|
requirements_lock = "@rules_fuzzing//fuzzing:requirements.txt",
|
2022-09-09 14:08:57 +00:00
|
|
|
extra_pip_args = ["--require-hashes"],
|
|
|
|
)
|
|
|
|
diff --git a/bazel/repositories_extra.bzl b/bazel/repositories_extra.bzl
|
2024-07-27 06:49:29 +00:00
|
|
|
index 7fd1dc4095..001de36a16 100644
|
2022-09-09 14:08:57 +00:00
|
|
|
--- a/bazel/repositories_extra.bzl
|
|
|
|
+++ b/bazel/repositories_extra.bzl
|
2024-04-26 17:01:46 +00:00
|
|
|
@@ -2,19 +2,11 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
|
|
|
|
load("@com_github_rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
|
2022-09-09 14:08:57 +00:00
|
|
|
load("@emsdk//:deps.bzl", emsdk_deps = "deps")
|
|
|
|
load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime:crates.bzl", "wasmtime_fetch_remote_crates")
|
2024-04-26 17:01:46 +00:00
|
|
|
-load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
|
|
|
|
+load("@rules_python//python:repositories.bzl", "py_repositories")
|
2022-09-09 14:08:57 +00:00
|
|
|
load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates")
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
-def _python_minor_version(python_version):
|
|
|
|
- return "_".join(python_version.split(".")[:-1])
|
|
|
|
-
|
2022-09-09 14:08:57 +00:00
|
|
|
-# Python version for `rules_python`
|
2024-07-27 06:49:29 +00:00
|
|
|
-PYTHON_VERSION = "3.11.9"
|
2023-10-19 13:55:26 +00:00
|
|
|
-PYTHON_MINOR_VERSION = _python_minor_version(PYTHON_VERSION)
|
2022-09-09 14:08:57 +00:00
|
|
|
-
|
|
|
|
# Envoy deps that rely on a first stage of dependency loading in envoy_dependencies().
|
2023-10-19 13:55:26 +00:00
|
|
|
def envoy_dependencies_extra(
|
|
|
|
- python_version = PYTHON_VERSION,
|
|
|
|
ignore_root_user_error = False):
|
2022-09-09 14:08:57 +00:00
|
|
|
emsdk_deps()
|
|
|
|
raze_fetch_remote_crates()
|
2024-04-26 17:01:46 +00:00
|
|
|
@@ -22,11 +14,4 @@ def envoy_dependencies_extra(
|
|
|
|
rules_proto_grpc_toolchains()
|
|
|
|
py_repositories()
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
- # Registers underscored Python minor version - eg `python3_10`
|
|
|
|
- python_register_toolchains(
|
2023-10-19 13:55:26 +00:00
|
|
|
- name = "python%s" % _python_minor_version(python_version),
|
2022-09-09 14:08:57 +00:00
|
|
|
- python_version = python_version,
|
2023-10-19 13:55:26 +00:00
|
|
|
- ignore_root_user_error = ignore_root_user_error,
|
2022-09-09 14:08:57 +00:00
|
|
|
- )
|
|
|
|
-
|
|
|
|
aspect_bazel_lib_dependencies()
|
2023-02-19 20:43:05 +00:00
|
|
|
--
|
2024-07-27 06:49:29 +00:00
|
|
|
2.45.1
|
2023-02-19 20:43:05 +00:00
|
|
|
|