Skip to content

Commit

Permalink
Replace pip-compile with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 25, 2024
1 parent 7fa8466 commit 4655240
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 32 deletions.
39 changes: 24 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ci:
skip:
- lock
- pip-compile
- deps
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down Expand Up @@ -92,31 +93,39 @@ 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
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
additional_dependencies:
- uv>=0.4.3
- id: lock
name: Update requirements-lock.txt
alias: lock
always_run: true
entry: pip-compile pyproject.toml --upgrade
entry: python3 -m uv pip compile -q --upgrade --constraint=.config/constraints.txt --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
files: ^.config\/.*requirements.*$
language: python
language_version: "3.10" # minimal we support officially
pass_filenames: false
stages: [manual]
additional_dependencies:
- pip>=22.3.1
- uv>=0.4.3
22 changes: 5 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -192,3 +175,8 @@ git_describe_command = [
"--match",
"v*.*"
]

[tool.uv.pip]
annotation-style = "line"
custom-compile-command = "tox run deps"
no-emit-package = ["pip", "resolvelib", "typing_extensions", "uv"]

0 comments on commit 4655240

Please sign in to comment.