From cdff333d8bf6ddec01cf8328daa14f2e185e6a1f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 22 Apr 2024 14:09:42 +0100 Subject: [PATCH] Use uv for requirements (#333) --- requirements/compile.py | 44 ++++++++++++----------------------------- requirements/py310.txt | 17 ++++------------ requirements/py311.txt | 17 ++++------------ requirements/py312.txt | 17 ++++------------ requirements/py38.txt | 17 ++++------------ requirements/py39.txt | 17 ++++------------ 6 files changed, 33 insertions(+), 96 deletions(-) diff --git a/requirements/compile.py b/requirements/compile.py index 0b3075d..df83681 100755 --- a/requirements/compile.py +++ b/requirements/compile.py @@ -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"]) diff --git a/requirements/py310.txt b/requirements/py310.txt index 15331b5..22830d3 100644 --- a/requirements/py310.txt +++ b/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 black==24.4.0 \ --hash=sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d \ --hash=sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd \ @@ -27,12 +23,11 @@ black==24.4.0 \ --hash=sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e \ --hash=sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641 \ --hash=sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2 - # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -coverage[toml]==7.4.4 \ +coverage==7.4.4 \ --hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \ --hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \ --hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \ @@ -85,7 +80,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 @@ -119,13 +113,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 diff --git a/requirements/py311.txt b/requirements/py311.txt index 106a5ae..99e77eb 100644 --- a/requirements/py311.txt +++ b/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 black==24.4.0 \ --hash=sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d \ --hash=sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd \ @@ -27,12 +23,11 @@ black==24.4.0 \ --hash=sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e \ --hash=sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641 \ --hash=sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2 - # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -coverage[toml]==7.4.4 \ +coverage==7.4.4 \ --hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \ --hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \ --hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \ @@ -85,7 +80,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 @@ -115,10 +109,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 diff --git a/requirements/py312.txt b/requirements/py312.txt index eafcf6f..4e56ded 100644 --- a/requirements/py312.txt +++ b/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 black==24.4.0 \ --hash=sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d \ --hash=sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd \ @@ -27,12 +23,11 @@ black==24.4.0 \ --hash=sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e \ --hash=sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641 \ --hash=sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2 - # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -coverage[toml]==7.4.4 \ +coverage==7.4.4 \ --hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \ --hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \ --hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \ @@ -85,7 +80,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 @@ -115,10 +109,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 diff --git a/requirements/py38.txt b/requirements/py38.txt index e02f342..9e3b9fa 100644 --- a/requirements/py38.txt +++ b/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 black==24.4.0 \ --hash=sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d \ --hash=sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd \ @@ -27,12 +23,11 @@ black==24.4.0 \ --hash=sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e \ --hash=sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641 \ --hash=sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2 - # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -coverage[toml]==7.4.4 \ +coverage==7.4.4 \ --hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \ --hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \ --hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \ @@ -85,7 +80,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 @@ -123,13 +117,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 diff --git a/requirements/py39.txt b/requirements/py39.txt index 7efe0d9..f3457b0 100644 --- a/requirements/py39.txt +++ b/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 black==24.4.0 \ --hash=sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d \ --hash=sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd \ @@ -27,12 +23,11 @@ black==24.4.0 \ --hash=sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e \ --hash=sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641 \ --hash=sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2 - # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -coverage[toml]==7.4.4 \ +coverage==7.4.4 \ --hash=sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c \ --hash=sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63 \ --hash=sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7 \ @@ -85,7 +80,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 @@ -123,13 +117,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