Skip to content

Commit

Permalink
Use uv for requirements (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Apr 22, 2024
1 parent b0bc6ab commit 233ffdb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 76 deletions.
44 changes: 13 additions & 31 deletions requirements/compile.py
Expand Up @@ -4,41 +4,23 @@
import os
import subprocess
import sys
from functools import partial
from pathlib import Path

if __name__ == "__main__":
os.chdir(Path(__file__).parent)
os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py"
os.environ["PIP_REQUIRE_VIRTUALENV"] = "0"
common_args = [
"-m",
"piptools",
"uv",
"pip",
"compile",
"--quiet",
"--generate-hashes",
"--allow-unsafe",
] + sys.argv[1:]
subprocess.run(
["python3.8", *common_args, "-o", "py38.txt"],
check=True,
capture_output=True,
)
subprocess.run(
["python3.9", *common_args, "-o", "py39.txt"],
check=True,
capture_output=True,
)
subprocess.run(
["python3.10", *common_args, "-o", "py310.txt"],
check=True,
capture_output=True,
)
subprocess.run(
["python3.11", *common_args, "-o", "py311.txt"],
check=True,
capture_output=True,
)
subprocess.run(
["python3.12", *common_args, "-o", "py312.txt"],
check=True,
capture_output=True,
)
"requirements.in",
*sys.argv[1:],
]
run = partial(subprocess.run, check=True)
run([*common_args, "--python", "3.8", "--output-file", "py38.txt"])
run([*common_args, "--python", "3.9", "--output-file", "py39.txt"])
run([*common_args, "--python", "3.10", "--output-file", "py310.txt"])
run([*common_args, "--python", "3.11", "--output-file", "py311.txt"])
run([*common_args, "--python", "3.12", "--output-file", "py312.txt"])
11 changes: 2 additions & 9 deletions requirements/py310.txt
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# requirements/compile.py
#
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.10 --output-file py310.txt
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand Down Expand Up @@ -40,17 +36,14 @@ pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-flake8-path
# pytest-randomly
pytest-flake8-path==1.5.0 \
--hash=sha256:2c144a3127995d34e82df397350dbef7780c9920c5b7e9ebc81f63299011381e \
--hash=sha256:8766879344883e67762fc3f4f8f0d624a0d143de71f6488788599b3583e279a9
# via -r requirements.in
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
Expand Down
11 changes: 2 additions & 9 deletions requirements/py311.txt
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# requirements/compile.py
#
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.11 --output-file py311.txt
flake8==7.0.0 \
--hash=sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132 \
--hash=sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3
Expand Down Expand Up @@ -36,14 +32,11 @@ pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-flake8-path
# pytest-randomly
pytest-flake8-path==1.5.0 \
--hash=sha256:2c144a3127995d34e82df397350dbef7780c9920c5b7e9ebc81f63299011381e \
--hash=sha256:8766879344883e67762fc3f4f8f0d624a0d143de71f6488788599b3583e279a9
# via -r requirements.in
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
11 changes: 2 additions & 9 deletions requirements/py312.txt
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# requirements/compile.py
#
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.12 --output-file py312.txt
flake8==7.0.0 \
--hash=sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132 \
--hash=sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3
Expand Down Expand Up @@ -36,14 +32,11 @@ pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-flake8-path
# pytest-randomly
pytest-flake8-path==1.5.0 \
--hash=sha256:2c144a3127995d34e82df397350dbef7780c9920c5b7e9ebc81f63299011381e \
--hash=sha256:8766879344883e67762fc3f4f8f0d624a0d143de71f6488788599b3583e279a9
# via -r requirements.in
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
11 changes: 2 additions & 9 deletions requirements/py38.txt
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# requirements/compile.py
#
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.8 --output-file py38.txt
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand Down Expand Up @@ -44,17 +40,14 @@ pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-flake8-path
# pytest-randomly
pytest-flake8-path==1.5.0 \
--hash=sha256:2c144a3127995d34e82df397350dbef7780c9920c5b7e9ebc81f63299011381e \
--hash=sha256:8766879344883e67762fc3f4f8f0d624a0d143de71f6488788599b3583e279a9
# via -r requirements.in
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
Expand Down
11 changes: 2 additions & 9 deletions requirements/py39.txt
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# requirements/compile.py
#
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.9 --output-file py39.txt
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand Down Expand Up @@ -44,17 +40,14 @@ pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-flake8-path
# pytest-randomly
pytest-flake8-path==1.5.0 \
--hash=sha256:2c144a3127995d34e82df397350dbef7780c9920c5b7e9ebc81f63299011381e \
--hash=sha256:8766879344883e67762fc3f4f8f0d624a0d143de71f6488788599b3583e279a9
# via -r requirements.in
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
Expand Down

0 comments on commit 233ffdb

Please sign in to comment.