From 71ed6d08139703f8fddfa06370b3dbcc082bd497 Mon Sep 17 00:00:00 2001 From: CoderJoshDK <74162303+CoderJoshDK@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:00:32 -0400 Subject: [PATCH 1/4] feat: use uv for package management --- .github/workflows/main.yml | 7 +++-- pyproject.toml | 2 +- requirements-dev.txt | 62 +++++++++++++------------------------- 3 files changed, 26 insertions(+), 45 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c30dd5a..852439e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,11 @@ jobs: - uses: actions/setup-python@v4 with: python-version: "3.11" - cache: pip - cache-dependency-path: requirements-dev.txt - - run: pip install -r requirements-dev.txt + - name: download uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + + - run: uv pip install --system -r requirements-dev.txt - name: set git config run: | diff --git a/pyproject.toml b/pyproject.toml index 9a4c80c..e2f1848 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,6 @@ dependencies = [ [project.optional-dependencies] dev = [ "packaging~=23.1", - "pip-tools>=7.3.0,<8.0.0", + "uv>=0.1.24", "urllib3>=2.0.5,<3.0.0", ] diff --git a/requirements-dev.txt b/requirements-dev.txt index ec9cbe4..fc40de4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,49 +1,29 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --extra=dev --generate-hashes --output-file=./requirements-dev.txt --unsafe-package=ruff ./pyproject.toml -# -build==1.0.3 \ - --hash=sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b \ - --hash=sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f - # via pip-tools -click==8.1.7 \ - --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ - --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de - # via pip-tools +# This file was autogenerated by uv via the following command: +# uv pip compile --extra=dev --generate-hashes pyproject.toml -o requirements-dev.txt --unsafe-package=ruff packaging==23.1 \ --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f - # via - # build - # ruff-pre-commit (./pyproject.toml) -pip==23.2.1 \ - --hash=sha256:7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be \ - --hash=sha256:fb0bd5435b3200c602b5bf61d2d43c2f13c02e29c1707567ae7fbc514eb9faf2 - # via pip-tools -pip-tools==7.3.0 \ - --hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \ - --hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d - # via ruff-pre-commit (./pyproject.toml) -pyproject-hooks==1.0.0 \ - --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ - --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 - # via build -setuptools==68.2.2 \ - --hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \ - --hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a - # via pip-tools urllib3==2.0.5 \ --hash=sha256:13abf37382ea2ce6fb744d4dad67838eec857c9f4f57009891805e0b5e123594 \ --hash=sha256:ef16afa8ba34a1f989db38e1dbbe0c302e4289a47856990d0682e374563ce35e - # via ruff-pre-commit (./pyproject.toml) -wheel==0.41.2 \ - --hash=sha256:0c5ac5ff2afb79ac23ab82bab027a0be7b5dbcf2e54dc50efe4bf507de1f7985 \ - --hash=sha256:75909db2664838d015e3d9139004ee16711748a52c8f336b52882266540215d8 - # via pip-tools +uv==0.1.24 \ + --hash=sha256:1f8abf3330570acbf6188da635c4fe9cc936f9f36b49ce4992a2df56b2155421 \ + --hash=sha256:2e4d09bed7759253a81c1141e01d58242fb964e6eea85ed2f3d15f6597c504fa \ + --hash=sha256:33d74c4c67df34de18c4318a6c568efef9dfab6d05332b1d1eddc8e516fc8806 \ + --hash=sha256:4d51afe18f1283417d2fccfc375a093c149a993ce25559982deeeb0b996c0c04 \ + --hash=sha256:53bed670553025d7034592954454df5e31493d4e111c32a14c091669da0d38ba \ + --hash=sha256:735c11c977dfe044ee5395c523503b9ffd9d055e924a86dba75130f60411a5d2 \ + --hash=sha256:76a8abb05b957beddf7fb35b4da5e8b1d43326a423615eefa043f61f9720f381 \ + --hash=sha256:7ed69aa1798cb7f5000d4ac7d0b0185b39fd2798364a4f22f48ef97fd7e487e2 \ + --hash=sha256:850373ba442ee33328a89a83ceb053f3b53cb93d7505ff01b0a8575d9462f012 \ + --hash=sha256:87cce6b44a86e761f845a85e52ea0de44fcd579b9a63b2d856118b0d1847bca7 \ + --hash=sha256:94dfba0b9879e0141b9bcf6e6f990fe585f73082dbaac61d1ef3acd0dd013b9b \ + --hash=sha256:9de5d816da9a46f9119f0980f92ad275ec1a87c4e25818e7f3e8b46a503afe23 \ + --hash=sha256:a273f468f170b12e6cb6362aa90a65dd12a397db02df55ffb47a21c11b577d8c \ + --hash=sha256:a407f128672d1c4d924f3bf36fbba3df66d4d73a713811dd98aab5224528f201 \ + --hash=sha256:d87a9c4b35a4a1347586ec8f194045d96e314b822a66c48eebb5787d9c49461a \ + --hash=sha256:e026831b555d219549275b52d64098c0b6f8bade8cc48c9b26dd88680f083743 \ + --hash=sha256:f95f5224367186d4d4ee48795c7476a9ec21c48bcd141caf1d5cc5c9c811ab35 -# WARNING: The following packages were not pinned, but pip requires them to be -# pinned when the requirements file includes hashes and the requirement is not -# satisfied by a package already installed. Consider using the --allow-unsafe flag. +# The following packages were excluded from the output: # ruff From 73818cb71b445bbee10ffdfb5f40c5c78f5a5816 Mon Sep 17 00:00:00 2001 From: CoderJoshDK <74162303+CoderJoshDK@users.noreply.github.com> Date: Sat, 23 Mar 2024 08:19:47 -0400 Subject: [PATCH 2/4] build: bump setup-python version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 852439e..adba977 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" From a89d23053895dacb3990bf9619fbf23e0418f645 Mon Sep 17 00:00:00 2001 From: CoderJoshDK <74162303+CoderJoshDK@users.noreply.github.com> Date: Sun, 31 Mar 2024 08:24:00 -0400 Subject: [PATCH 3/4] build: emit `uv` from `requirements-dev.txt` `uv` should be used to install all required packages. However, you need to have `uv` installed first. Meaning, you end up in a circle dependency. While this should not result in any issues, this commit is to help ensure that. The main motivation for this: https://github.com/astral-sh/ruff-pre-commit/pull/77#discussion_r1536644913 In development, you only need `uv` for compiling the `requirements-dev.txt` file. --- requirements-dev.txt | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fc40de4..1ac0491 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,29 +1,12 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --extra=dev --generate-hashes pyproject.toml -o requirements-dev.txt --unsafe-package=ruff +# uv pip compile --extra=dev --generate-hashes -o requirements-dev.txt --no-emit-package=ruff --no-emit-package=uv pyproject.toml packaging==23.1 \ --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f urllib3==2.0.5 \ --hash=sha256:13abf37382ea2ce6fb744d4dad67838eec857c9f4f57009891805e0b5e123594 \ --hash=sha256:ef16afa8ba34a1f989db38e1dbbe0c302e4289a47856990d0682e374563ce35e -uv==0.1.24 \ - --hash=sha256:1f8abf3330570acbf6188da635c4fe9cc936f9f36b49ce4992a2df56b2155421 \ - --hash=sha256:2e4d09bed7759253a81c1141e01d58242fb964e6eea85ed2f3d15f6597c504fa \ - --hash=sha256:33d74c4c67df34de18c4318a6c568efef9dfab6d05332b1d1eddc8e516fc8806 \ - --hash=sha256:4d51afe18f1283417d2fccfc375a093c149a993ce25559982deeeb0b996c0c04 \ - --hash=sha256:53bed670553025d7034592954454df5e31493d4e111c32a14c091669da0d38ba \ - --hash=sha256:735c11c977dfe044ee5395c523503b9ffd9d055e924a86dba75130f60411a5d2 \ - --hash=sha256:76a8abb05b957beddf7fb35b4da5e8b1d43326a423615eefa043f61f9720f381 \ - --hash=sha256:7ed69aa1798cb7f5000d4ac7d0b0185b39fd2798364a4f22f48ef97fd7e487e2 \ - --hash=sha256:850373ba442ee33328a89a83ceb053f3b53cb93d7505ff01b0a8575d9462f012 \ - --hash=sha256:87cce6b44a86e761f845a85e52ea0de44fcd579b9a63b2d856118b0d1847bca7 \ - --hash=sha256:94dfba0b9879e0141b9bcf6e6f990fe585f73082dbaac61d1ef3acd0dd013b9b \ - --hash=sha256:9de5d816da9a46f9119f0980f92ad275ec1a87c4e25818e7f3e8b46a503afe23 \ - --hash=sha256:a273f468f170b12e6cb6362aa90a65dd12a397db02df55ffb47a21c11b577d8c \ - --hash=sha256:a407f128672d1c4d924f3bf36fbba3df66d4d73a713811dd98aab5224528f201 \ - --hash=sha256:d87a9c4b35a4a1347586ec8f194045d96e314b822a66c48eebb5787d9c49461a \ - --hash=sha256:e026831b555d219549275b52d64098c0b6f8bade8cc48c9b26dd88680f083743 \ - --hash=sha256:f95f5224367186d4d4ee48795c7476a9ec21c48bcd141caf1d5cc5c9c811ab35 # The following packages were excluded from the output: # ruff +# uv From 3abffaf3f10a27359a38c4a6df89c0f52bf8c99e Mon Sep 17 00:00:00 2001 From: CoderJoshDK <74162303+CoderJoshDK@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:22:12 -0400 Subject: [PATCH 4/4] feat: remove uv from pyproject dev dependency --- pyproject.toml | 1 - requirements-dev.txt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e2f1848..881c66a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,5 @@ dependencies = [ [project.optional-dependencies] dev = [ "packaging~=23.1", - "uv>=0.1.24", "urllib3>=2.0.5,<3.0.0", ] diff --git a/requirements-dev.txt b/requirements-dev.txt index 1ac0491..c98d526 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --extra=dev --generate-hashes -o requirements-dev.txt --no-emit-package=ruff --no-emit-package=uv pyproject.toml +# uv pip compile --extra=dev --generate-hashes -o requirements-dev.txt --no-emit-package=ruff pyproject.toml packaging==23.1 \ --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f @@ -9,4 +9,3 @@ urllib3==2.0.5 \ # The following packages were excluded from the output: # ruff -# uv