Skip to content

Commit

Permalink
Use uv for requirements (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Apr 22, 2024
1 parent ee83d08 commit 84e849f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 91 deletions.
44 changes: 13 additions & 31 deletions requirements/compile.py
Original file line number Diff line number Diff line change
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"])
16 changes: 4 additions & 12 deletions requirements/py310.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# requirements/compile.py
#
coverage[toml]==7.4.4 \
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.10 --output-file py310.txt
coverage==7.4.4 \
--hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \
--hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \
--hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \
Expand Down Expand Up @@ -57,7 +53,6 @@ coverage[toml]==7.4.4 \
--hash=sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2 \
--hash=sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48 \
--hash=sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4
# via -r requirements.in
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand All @@ -77,13 +72,10 @@ pluggy==1.5.0 \
pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-randomly
# via pytest-randomly
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
16 changes: 4 additions & 12 deletions requirements/py311.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# requirements/compile.py
#
coverage[toml]==7.4.4 \
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.11 --output-file py311.txt
coverage==7.4.4 \
--hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \
--hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \
--hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \
Expand Down Expand Up @@ -57,7 +53,6 @@ coverage[toml]==7.4.4 \
--hash=sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2 \
--hash=sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48 \
--hash=sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4
# via -r requirements.in
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
Expand All @@ -73,10 +68,7 @@ pluggy==1.5.0 \
pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-randomly
# via pytest-randomly
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
16 changes: 4 additions & 12 deletions requirements/py312.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# requirements/compile.py
#
coverage[toml]==7.4.4 \
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.12 --output-file py312.txt
coverage==7.4.4 \
--hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \
--hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \
--hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \
Expand Down Expand Up @@ -57,7 +53,6 @@ coverage[toml]==7.4.4 \
--hash=sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2 \
--hash=sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48 \
--hash=sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4
# via -r requirements.in
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
Expand All @@ -73,10 +68,7 @@ pluggy==1.5.0 \
pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-randomly
# via pytest-randomly
pytest-randomly==3.15.0 \
--hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \
--hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047
# via -r requirements.in
16 changes: 4 additions & 12 deletions requirements/py38.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# requirements/compile.py
#
coverage[toml]==7.4.4 \
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.8 --output-file py38.txt
coverage==7.4.4 \
--hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \
--hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \
--hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \
Expand Down Expand Up @@ -57,7 +53,6 @@ coverage[toml]==7.4.4 \
--hash=sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2 \
--hash=sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48 \
--hash=sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4
# via -r requirements.in
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand All @@ -81,13 +76,10 @@ pluggy==1.5.0 \
pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-randomly
# via pytest-randomly
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
16 changes: 4 additions & 12 deletions requirements/py39.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# requirements/compile.py
#
coverage[toml]==7.4.4 \
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes requirements.in --python 3.9 --output-file py39.txt
coverage==7.4.4 \
--hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \
--hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \
--hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \
Expand Down Expand Up @@ -57,7 +53,6 @@ coverage[toml]==7.4.4 \
--hash=sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2 \
--hash=sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48 \
--hash=sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4
# via -r requirements.in
exceptiongroup==1.2.1 \
--hash=sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad \
--hash=sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16
Expand All @@ -81,13 +76,10 @@ pluggy==1.5.0 \
pytest==8.1.1 \
--hash=sha256:2a8386cfc11fa9d2c50ee7b2a57e7d898ef90470a7a34c4b949ff59662bb78b7 \
--hash=sha256:ac978141a75948948817d360297b7aae0fcb9d6ff6bc9ec6d514b85d5a65c044
# via
# -r requirements.in
# pytest-randomly
# via pytest-randomly
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 84e849f

Please sign in to comment.