Skip to content

Commit 04f7d00

Browse files
[build] Move python to force interpreter explicitly on pip
1 parent ac145e5 commit 04f7d00

File tree

4 files changed

+387
-30
lines changed

4 files changed

+387
-30
lines changed

‎WORKSPACE

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,25 @@ http_archive(
6060
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
6161

6262
python_register_toolchains(
63-
name = "python3_9",
63+
name = "python_toolchain",
6464
python_version = "3.9",
6565
)
6666

67+
load("@python_toolchain//:defs.bzl", "interpreter")
68+
6769
# This one is only needed if you're using the packaging rules.
68-
load("@rules_python//python:pip.bzl", "pip_install")
70+
load("@rules_python//python:pip.bzl", "pip_parse")
6971

70-
pip_install(
71-
name = "dev_requirements",
72-
requirements = "//py:requirements.txt",
72+
pip_parse(
73+
name = "py_dev_requirements",
74+
requirements_lock = "//py:requirements_lock.txt",
75+
python_interpreter_target = interpreter,
7376
)
7477

78+
load("@py_dev_requirements//:requirements.bzl", "install_deps")
79+
80+
install_deps()
81+
7582
http_archive(
7683
name = "rules_proto",
7784
sha256 = "9fc210a34f0f9e7cc31598d109b5d069ef44911a82f507d5a88716db171615a8",

‎py/BUILD.bazel

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
22
load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")
33
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
44
load("@rules_python//python:packaging.bzl", "py_package", "py_wheel")
5-
load("@dev_requirements//:requirements.bzl", "requirement")
5+
load("@py_dev_requirements//:requirements.bzl", "requirement")
66
load("//common:defs.bzl", "copy_file")
77
load("//py:defs.bzl", "py_test_suite")
88
load("//py/private:browsers.bzl", "BROWSERS")
99

10+
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
11+
12+
compile_pip_requirements(
13+
# base name for generated targets, typically "requirements"
14+
name = "requirements",
15+
requirements_in = ":requirements.txt",
16+
requirements_txt = ":requirements_lock.txt",
17+
)
18+
1019
SE_VERSION = "4.1.5"
1120

1221
BROWSER_VERSIONS = [

‎py/requirements.txt

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
attrs
2-
certifi
3-
dataclasses
4-
debugpy
5-
h11
6-
idna
7-
importlib_metadata
8-
inflection
9-
iniconfig
10-
more_itertools
11-
multidict
12-
outcome
13-
pluggy
14-
py
15-
pytest~=6.1
16-
pytest-instafail~=0.4
17-
pytest-mock~=3.3
18-
pytest-trio~=0.7
19-
sortedcontainers
20-
sniffio
21-
trio~=0.17
22-
trio_websocket~=0.9
23-
urllib3[secure, socks]~=1.26
24-
zipp
1+
async-generator==1.10
2+
attrs==21.4.0
3+
certifi==2021.10.8
4+
cffi==1.15.0
5+
cryptography==37.0.2
6+
dataclasses==0.6
7+
debugpy==1.6.0
8+
h11==0.13.0
9+
idna==3.3
10+
importlib-metadata==4.11.3
11+
inflection==0.5.1
12+
iniconfig==1.1.1
13+
more-itertools==8.13.0
14+
multidict==6.0.2
15+
outcome==1.1.0
16+
packaging==21.3
17+
pluggy==1.0.0
18+
py==1.11.0
19+
pycparser==2.21
20+
pyOpenSSL==22.0.0
21+
pyparsing==3.0.8
22+
PySocks==1.7.1
23+
pytest==6.2.5
24+
pytest-instafail==0.4.2
25+
pytest-mock==3.7.0
26+
pytest-trio==0.7.0
27+
sniffio==1.2.0
28+
sortedcontainers==2.4.0
29+
toml==0.10.2
30+
trio==0.20.0
31+
trio-websocket==0.9.2
32+
urllib3==1.26.9
33+
wsproto==1.1.0
34+
zipp==3.8.0

0 commit comments

Comments
 (0)