From 3bd1f8e1afc3e22c5a0f7a43029eb7814d52deb8 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 25 Dec 2024 14:06:52 +0000 Subject: [PATCH] Replace pip-compile with uv --- .config/constraints.txt | 191 +++++++++++++++++++--------------------- .pre-commit-config.yaml | 34 ++++--- pyproject.toml | 33 ++++--- 3 files changed, 123 insertions(+), 135 deletions(-) diff --git a/.config/constraints.txt b/.config/constraints.txt index c9eb003..33fc119 100644 --- a/.config/constraints.txt +++ b/.config/constraints.txt @@ -1,103 +1,96 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras --unsafe-package=backports-tarfile --unsafe-package=cryptography --unsafe-package=exceptiongroup --unsafe-package=jeepney --unsafe-package=secretstorage --unsafe-package=twine pyproject.toml -# -babel==2.16.0 -beautifulsoup4==4.12.3 -build==1.2.2.post1 -cachetools==5.5.0 -cairocffi==1.7.1 -cairosvg==2.7.1 -certifi==2024.12.14 -cffi==1.17.1 -chardet==5.2.0 -charset-normalizer==3.4.0 -click==8.1.8 -colorama==0.4.6 -coverage==7.6.9 -cssselect2==0.7.0 -defusedxml==0.7.1 -diskcache==5.6.3 -distlib==0.3.9 -docutils==0.21.2 -filelock==3.16.1 -ghp-import==2.1.0 -gitdb==4.0.11 -gitpython==3.1.43 -idna==3.10 -importlib-metadata==8.5.0 -iniconfig==2.0.0 -jaraco-classes==3.4.0 -jaraco-context==6.0.1 -jaraco-functools==4.1.0 -jinja2==3.1.5 -keyring==25.5.0 -markdown==3.7 -markdown-exec==1.10.0 -markdown-it-py==3.0.0 -markupsafe==3.0.2 -mdurl==0.1.2 -mergedeep==1.3.4 -mkdocs==1.6.1 -mkdocs-autorefs==1.2.0 -mkdocs-gen-files==0.5.0 -mkdocs-get-deps==0.2.0 -mkdocs-htmlproofer-plugin==1.3.0 -mkdocs-material==9.5.49 -mkdocs-material-extensions==1.3.1 -more-itertools==10.5.0 -nh3==0.2.20 -packaging==24.2 -paginate==0.5.7 -pathspec==0.12.1 -pillow==11.0.0 -pip==24.3.1 -pipdeptree==2.24.0 -pkginfo==1.12.0 -platformdirs==4.3.6 -pluggy==1.5.0 -py-cpuinfo==9.0.0 -pycparser==2.22 -pygments==2.18.0 -pymdown-extensions==10.12 -pyproject-api==1.8.0 -pyproject-hooks==1.2.0 -pytest==8.3.4 -pytest-benchmark==5.1.0 -pytest-plus==0.7.0 -python-dateutil==2.9.0.post0 -pyyaml==6.0.2 -pyyaml-env-tag==0.1 -readme-renderer==44.0 -regex==2024.11.6 -requests==2.32.3 -requests-toolbelt==1.0.0 -rfc3986==2.0.0 -rich==13.9.4 -setuptools==75.6.0 -shellingham==1.5.4 -six==1.17.0 -smmap==5.0.1 -soupsieve==2.6 -subprocess-tee==0.4.2 -tinycss2==1.4.0 -tomli==2.0.1 ; python_version < "3.11" -tox==4.23.2 -typer==0.15.1 -typer-config==1.4.2 -typing-extensions==4.12.2 -urllib3==2.2.3 -virtualenv==20.28.0 -watchdog==6.0.0 -webencodings==0.5.1 -zipp==3.21.0 +# This file was autogenerated by uv via the following command: +# tox run -e deps +babel==2.16.0 # via mkdocs-material +beautifulsoup4==4.12.3 # via mkdocs-htmlproofer-plugin +build==1.2.2.post1 # via mk (pyproject.toml) +cachetools==5.5.0 # via tox +cairocffi==1.7.1 # via cairosvg +cairosvg==2.7.1 # via mk (pyproject.toml) +certifi==2024.12.14 # via requests +cffi==1.17.1 # via cairocffi +chardet==5.2.0 # via tox +charset-normalizer==3.4.0 # via requests +click==8.1.8 # via mkdocs, typer +colorama==0.4.6 # via mkdocs-material, tox +coverage==7.6.9 # via mk (pyproject.toml) +cssselect2==0.7.0 # via cairosvg +defusedxml==0.7.1 # via cairosvg +diskcache==5.6.3 # via mk (pyproject.toml) +distlib==0.3.9 # via virtualenv +docutils==0.21.2 # via readme-renderer +filelock==3.16.1 # via tox, virtualenv +ghp-import==2.1.0 # via mkdocs +gitdb==4.0.11 # via gitpython +gitpython==3.1.43 # via mk (pyproject.toml) +idna==3.10 # via requests +importlib-metadata==8.5.0 # via keyring +iniconfig==2.0.0 # via pytest +jaraco-classes==3.4.0 # via keyring +jaraco-context==6.0.1 # via keyring +jaraco-functools==4.1.0 # via keyring +jinja2==3.1.5 # via mkdocs, mkdocs-material +keyring==25.5.0 # via twine +markdown==3.7 # via mkdocs, mkdocs-autorefs, mkdocs-htmlproofer-plugin, mkdocs-material, pymdown-extensions +markdown-exec==1.10.0 # via mk (pyproject.toml) +markdown-it-py==3.0.0 # via rich +markupsafe==3.0.2 # via jinja2, mkdocs, mkdocs-autorefs +mdurl==0.1.2 # via markdown-it-py +mergedeep==1.3.4 # via mkdocs, mkdocs-get-deps +mkdocs==1.6.1 # via mkdocs-autorefs, mkdocs-gen-files, mkdocs-htmlproofer-plugin, mkdocs-material, mk (pyproject.toml) +mkdocs-autorefs==1.2.0 # via mk (pyproject.toml) +mkdocs-gen-files==0.5.0 # via mk (pyproject.toml) +mkdocs-get-deps==0.2.0 # via mkdocs +mkdocs-htmlproofer-plugin==1.3.0 # via mk (pyproject.toml) +mkdocs-material==9.5.49 # via mk (pyproject.toml) +mkdocs-material-extensions==1.3.1 # via mkdocs-material, mk (pyproject.toml) +more-itertools==10.5.0 # via jaraco-classes, jaraco-functools +nh3==0.2.20 # via readme-renderer +packaging==24.2 # via build, mkdocs, pipdeptree, pyproject-api, pytest, tox, twine, mk (pyproject.toml) +paginate==0.5.7 # via mkdocs-material +pathspec==0.12.1 # via mkdocs +pillow==11.0.0 # via cairosvg, mk (pyproject.toml) +pipdeptree==2.24.0 # via mk (pyproject.toml) +pkginfo==1.12.0 # via twine +platformdirs==4.3.6 # via mkdocs-get-deps, tox, virtualenv +pluggy==1.5.0 # via pytest, tox, mk (pyproject.toml) +py-cpuinfo==9.0.0 # via pytest-benchmark +pycparser==2.22 # via cffi +pygments==2.18.0 # via mkdocs-material, readme-renderer, rich +pymdown-extensions==10.12 # via markdown-exec, mkdocs-material, mk (pyproject.toml) +pyproject-api==1.8.0 # via tox +pyproject-hooks==1.2.0 # via build +pytest==8.3.4 # via pytest-benchmark, pytest-plus, mk (pyproject.toml) +pytest-benchmark==5.1.0 # via mk (pyproject.toml) +pytest-plus==0.7.0 # via mk (pyproject.toml) +python-dateutil==2.9.0.post0 # via ghp-import +pyyaml==6.0.2 # via mkdocs, mkdocs-get-deps, pymdown-extensions, pyyaml-env-tag, mk (pyproject.toml) +pyyaml-env-tag==0.1 # via mkdocs +readme-renderer==44.0 # via twine +regex==2024.11.6 # via mkdocs-material +requests==2.32.3 # via mkdocs-htmlproofer-plugin, mkdocs-material, requests-toolbelt, twine +requests-toolbelt==1.0.0 # via twine +rfc3986==2.0.0 # via twine +rich==13.9.4 # via twine, typer, mk (pyproject.toml) +setuptools==75.6.0 # via mk (pyproject.toml) +shellingham==1.5.4 # via typer, mk (pyproject.toml) +six==1.17.0 # via python-dateutil +smmap==5.0.1 # via gitdb +soupsieve==2.6 # via beautifulsoup4 +subprocess-tee==0.4.2 # via mk (pyproject.toml) +tinycss2==1.4.0 # via cairosvg, cssselect2 +tomli==2.0.1 # via build, pyproject-api, pytest, tox, mk (pyproject.toml) +tox==4.23.2 # via mk (pyproject.toml) +typer==0.15.1 # via typer-config, mk (pyproject.toml) +typer-config==1.4.2 # via mk (pyproject.toml) +urllib3==2.2.3 # via requests, twine +virtualenv==20.28.0 # via tox +watchdog==6.0.0 # via mkdocs +webencodings==0.5.1 # via cssselect2, tinycss2 +zipp==3.21.0 # via importlib-metadata -# The following packages are considered to be unsafe in a requirements file: +# The following packages were excluded from the output: # backports-tarfile -# cryptography # exceptiongroup -# jeepney -# secretstorage +# pip # twine +# typing-extensions diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bd3170..ec9d748 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- ci: skip: - - lock + - pip-compile - deps repos: - repo: https://github.com/astral-sh/ruff-pre-commit @@ -92,31 +92,27 @@ repos: - subprocess-tee - typer-config - typer>=0.12.2 - - repo: https://github.com/jazzband/pip-tools - rev: 7.4.1 + + # keep at bottom as these are slower + - repo: local hooks: - - id: pip-compile - name: lock - alias: lock - always_run: true - # keyring excluded in order to keep lockfile portable between linux and macos - entry: pip-compile pyproject.toml - files: ^.config\/.*requirements.*$ + - id: deps + name: Upgrade constraints files and requirements + files: ^(pyproject\.toml|requirements\.txt)$ language: python language_version: "3.10" # minimal we support officially + entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml --upgrade pass_filenames: false - stages: [manual] + stages: + - manual additional_dependencies: - - pip>=22.3.1 + - uv>=0.4.3 - id: pip-compile - name: deps - alias: deps - always_run: true - entry: pip-compile pyproject.toml --upgrade - files: ^.config\/.*requirements.*$ + name: Check constraints files and requirements + files: ^(pyproject\.toml|requirements\.txt)$ language: python language_version: "3.10" # minimal we support officially + entry: python3 -m uv pip compile -q --all-extras --output-file=.config/constraints.txt pyproject.toml pass_filenames: false - stages: [manual] additional_dependencies: - - pip>=22.3.1 + - uv>=0.4.3 diff --git a/pyproject.toml b/pyproject.toml index fd0a3fd..0caa755 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,23 +100,6 @@ color_output = true error_summary = true no_incremental = true -[tool.pip-tools] -no_annotate = true -quiet = true - -[tool.pip-tools.compile] -all_extras = true -output_file = ".config/constraints.txt" -strip_extras = true -unsafe_package = [ - "backports-tarfile", - "cryptography", - "exceptiongroup", - "jeepney", - "secretstorage", - "twine" -] - [tool.pylint."MESSAGES CONTROL"] # increase from default is 50 which is too aggressive max-statements = 60 @@ -192,3 +175,19 @@ git_describe_command = [ "--match", "v*.*" ] + +[tool.uv.pip] +annotation-style = "line" +custom-compile-command = "tox run -e deps" +no-emit-package = [ + "backports-tarfile", + "cryptography", + "exceptiongroup", + "jeepney", + "pip", + "resolvelib", + "secretstorage", + "twine", + "typing_extensions", + "uv" +]