This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
forked from pypa/manylinux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
69 lines (60 loc) · 2.11 KB
/
noxfile.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
import re
from pathlib import Path
import nox
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
def update_python_dependencies(session):
session.install("pip-tools")
env = os.environ.copy()
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
# regenerate the constraints files
env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
session.run(
"pip-compile",
"--generate-hashes",
"requirements.in",
"--allow-unsafe",
"--upgrade",
"--output-file",
f"docker/build_scripts/requirements{session.python}.txt",
env=env,
)
@nox.session(python="3.10")
def update_python_tools(session):
session.install("pip-tools")
env = os.environ.copy()
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
# regenerate the constraints files
env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
session.run(
"pip-compile",
"--generate-hashes",
"requirements-base-tools.in",
"--upgrade",
"--output-file",
"docker/build_scripts/requirements-base-tools.txt",
env=env,
)
tools = Path("requirements-tools.in").read_text().split("\n")
for tool in tools:
if tool.strip() == "":
continue
tmp_file = Path(session.create_tmp()) / f"{tool}.in"
tmp_file.write_text(f"{tool}\n")
session.run(
"pip-compile",
"--generate-hashes",
str(tmp_file),
"--upgrade",
"--output-file",
f"docker/build_scripts/requirements-tools/{tool}",
env=env,
)
@nox.session(python="3.11", reuse_venv=True)
def update_native_dependencies(session):
session.install("lastversion>=3.5.0", "packaging", "requests")
session.run("python", "tools/update_native_dependencies.py", *session.posargs)
@nox.session(python="3.11", reuse_venv=True)
def update_interpreters_download(session):
session.install("packaging", "requests")
session.run("python", "tools/update_interpreters_download.py", *session.posargs)