diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e830a10..e39e1fc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: pretty-format-json args: @@ -20,7 +20,7 @@ repos: files: ^docs/.*\.rst$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.3 + rev: v0.3.7 hooks: - id: ruff args: @@ -46,29 +46,27 @@ repos: args: - "a3m" -- repo: https://github.com/jazzband/pip-tools - rev: 7.4.1 +- repo: https://github.com/astral-sh/uv-pre-commit + rev: 0.1.31 hooks: - id: pip-compile + args: + - "--python-version=3.12" + - "--output-file=requirements.txt" + - "pyproject.toml" files: | (?x)^( - setup.cfg| + pyproject.toml| requirements.txt )$ + - id: pip-compile args: - - "--output-file=requirements.txt" + - "--python-version=3.12" + - "--output-file=requirements-dev.txt" - "pyproject.toml" - -- repo: https://github.com/jazzband/pip-tools - rev: 7.4.1 - hooks: - - id: pip-compile + - "--extra=dev" files: | (?x)^( - setup.cfg| + pyproject.toml| requirements-dev.txt )$ - args: - - "--output-file=requirements-dev.txt" - - "--extra=dev" - - "pyproject.toml" diff --git a/Makefile b/Makefile index cc540478..96af247e 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ A3M_PIPELINE_DATA ?= $(CURDIR)/hack/compose-volume CURRENT_UID := $(shell id -u) CURRENT_GID := $(shell id -g) +PYTHON_VERSION = $(shell cat .python-version | awk -F '.' '{print $$1 "." $$2}') + define compose docker compose -f docker-compose.yml $(1) endef @@ -70,17 +72,17 @@ restart: ## Restart services .PHONY: pip-compile pip-compile: ## Compile pip requirements - pip-compile --output-file=requirements.txt pyproject.toml - pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml + uv pip compile --python-version=$(PYTHON_VERSION) --output-file=requirements.txt pyproject.toml + uv pip compile --python-version=$(PYTHON_VERSION) --output-file=requirements-dev.txt pyproject.toml --extra=dev .PHONY: pip-upgrade pip-upgrade: ## Upgrade pip requirements - pip-compile --upgrade --output-file=requirements.txt pyproject.toml - pip-compile --upgrade --extra=dev --output-file=requirements-dev.txt pyproject.toml + uv pip compile --upgrade --python-version=$(PYTHON_VERSION) --output-file=requirements.txt pyproject.toml + uv pip compile --upgrade --python-version=$(PYTHON_VERSION) --output-file=requirements-dev.txt pyproject.toml --extra=dev .PHONY: pip-sync pip-sync: ## Ensures that the local venv mirrors requirements-dev.txt. - pip-sync requirements-dev.txt + uv pip sync requirements-dev.txt .PHONY: db db: diff --git a/docs/contributing.rst b/docs/contributing.rst index a88e965e..35da0518 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -11,7 +11,7 @@ Python dependencies The requirements are listed in ``/pyproject.toml``. The constraints are relaxed with the purpose of allowing a3m to be used as a library. -We use `pip-tools` which pins the requirements in ``requirements.txt`` and +We use `uv` which pins the requirements in ``requirements.txt`` and ``requirements-dev.txt`` for our Docker image. We provide a few helpers: * ``make pip-compile`` generates the requirements with the latest versions of diff --git a/pyproject.toml b/pyproject.toml index a8154b41..5a1b5001 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,6 @@ dev = [ "pytest-env", "pytest-mock", "coverage", - "pip-tools", "grpcio-tools", "mypy", "tox", diff --git a/requirements-dev.txt b/requirements-dev.txt index 6053400a..c5c026f2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,14 +1,9 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.12 --output-file=requirements-dev.txt pyproject.toml --extra=dev alabaster==0.7.16 # via sphinx ammcpc==0.2.0 - # via a3m (pyproject.toml) -asgiref==3.8.0 +asgiref==3.8.1 # via django attrs==23.2.0 # via @@ -18,17 +13,12 @@ attrs==23.2.0 babel==2.14.0 # via sphinx bagit==1.8.1 - # via a3m (pyproject.toml) -boto3==1.34.67 - # via a3m (pyproject.toml) -botocore==1.34.67 +boto3==1.34.84 +botocore==1.34.84 # via # boto3 # s3transfer -build==1.1.1 - # via - # a3m (pyproject.toml) - # pip-tools +build==1.2.1 cachetools==5.3.3 # via tox certifi==2024.2.2 @@ -43,58 +33,45 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via - # a3m (pyproject.toml) # click-log - # pip-tools # scriv click-log==0.4.0 # via scriv colorama==0.4.6 # via tox -coverage[toml]==7.4.4 - # via - # a3m (pyproject.toml) - # pytest-cov +coverage==7.4.4 + # via pytest-cov cryptography==42.0.5 # via secretstorage +cssselect==1.2.0 + # via types-lxml distlib==0.3.8 # via virtualenv django==4.2.11 - # via - # a3m (pyproject.toml) - # django-stubs-ext + # via django-stubs-ext django-stubs-ext==4.2.7 - # via a3m (pyproject.toml) django-types==0.19.1 - # via a3m (pyproject.toml) doc8==1.1.1 - # via a3m (pyproject.toml) docutils==0.20.1 # via # doc8 # readme-renderer # restructuredtext-lint # sphinx -filelock==3.13.1 +filelock==3.13.4 # via # tox # virtualenv googleapis-common-protos==1.63.0 - # via - # a3m (pyproject.toml) - # grpcio-status + # via grpcio-status grpcio==1.62.1 # via - # a3m (pyproject.toml) # grpcio-reflection # grpcio-status # grpcio-tools grpcio-reflection==1.62.1 - # via a3m (pyproject.toml) grpcio-status==1.62.1 - # via a3m (pyproject.toml) grpcio-tools==1.62.1 - # via a3m (pyproject.toml) identify==2.5.35 # via pre-commit idna==3.7 @@ -105,7 +82,11 @@ importlib-metadata==7.1.0 # via twine iniconfig==2.0.0 # via pytest -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 + # via keyring +jaraco-context==5.3.0 + # via keyring +jaraco-functools==4.0.0 # via keyring jeepney==0.8.0 # via @@ -120,14 +101,12 @@ jmespath==1.0.1 # boto3 # botocore jsonschema==4.21.1 - # via a3m (pyproject.toml) jsonschema-specifications==2023.12.1 # via jsonschema -keyring==24.3.1 +keyring==25.1.0 # via twine lxml==4.9.4 # via - # a3m (pyproject.toml) # ammcpc # metsrw markdown-it-py==3.0.0 @@ -139,14 +118,14 @@ markupsafe==2.1.5 mdurl==0.1.2 # via markdown-it-py metsrw==0.5.1 - # via a3m (pyproject.toml) more-itertools==10.2.0 - # via jaraco-classes + # via + # jaraco-classes + # jaraco-functools mypy==1.9.0 - # via a3m (pyproject.toml) mypy-extensions==1.0.0 # via mypy -nh3==0.2.15 +nh3==0.2.17 # via readme-renderer nodeenv==1.8.0 # via pre-commit @@ -159,33 +138,27 @@ packaging==24.0 # tox pbr==6.0.0 # via stevedore -pip-tools==7.4.1 - # via a3m (pyproject.toml) pkginfo==1.10.0 # via twine platformdirs==4.2.0 # via - # a3m (pyproject.toml) # tox # virtualenv pluggy==1.4.0 # via # pytest # tox -pre-commit==3.6.2 - # via a3m (pyproject.toml) +pre-commit==3.7.0 prometheus-client==0.20.0 - # via a3m (pyproject.toml) protobuf==4.25.3 # via # googleapis-common-protos # grpcio-reflection # grpcio-status # grpcio-tools -pycparser==2.21 +pycparser==2.22 # via cffi pygfried==0.7.0 - # via a3m (pyproject.toml) pygments==2.17.2 # via # doc8 @@ -195,24 +168,17 @@ pygments==2.17.2 pyproject-api==1.6.1 # via tox pyproject-hooks==1.0.0 - # via - # build - # pip-tools + # via build pytest==8.1.1 # via - # a3m (pyproject.toml) # pytest-cov # pytest-django # pytest-env # pytest-mock -pytest-cov==4.1.0 - # via a3m (pyproject.toml) +pytest-cov==5.0.0 pytest-django==4.8.0 - # via a3m (pyproject.toml) pytest-env==1.1.3 - # via a3m (pyproject.toml) -pytest-mock==3.12.0 - # via a3m (pyproject.toml) +pytest-mock==3.14.0 python-dateutil==2.9.0.post0 # via botocore pyyaml==6.0.1 @@ -225,7 +191,6 @@ referencing==0.34.0 # jsonschema-specifications requests==2.31.0 # via - # a3m (pyproject.toml) # requests-toolbelt # scriv # sphinx @@ -237,27 +202,26 @@ restructuredtext-lint==1.4.0 rfc3986==2.0.0 # via twine rich==13.7.1 - # via - # a3m (pyproject.toml) - # twine + # via twine rpds-py==0.18.0 # via # jsonschema # referencing -ruff==0.3.3 - # via a3m (pyproject.toml) +ruff==0.3.7 s3transfer==0.10.1 # via boto3 scriv==1.5.1 - # via a3m (pyproject.toml) secretstorage==3.3.3 # via keyring +setuptools==69.5.1 + # via + # grpcio-tools + # nodeenv six==1.16.0 # via python-dateutil snowballstemmer==2.2.0 # via sphinx sphinx==7.2.6 - # via a3m (pyproject.toml) sphinxcontrib-applehelp==1.0.8 # via sphinx sphinxcontrib-devhelp==1.0.6 @@ -267,40 +231,32 @@ sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-mermaid==0.9.2 - # via a3m (pyproject.toml) sphinxcontrib-qthelp==1.0.7 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via doc8 tenacity==8.2.3 - # via a3m (pyproject.toml) -tox==4.14.1 - # via a3m (pyproject.toml) +tox==4.14.2 twine==5.0.0 - # via a3m (pyproject.toml) types-beautifulsoup4==4.12.0.20240229 # via types-lxml types-html5lib==1.1.11.20240228 # via types-beautifulsoup4 -types-lxml==2024.2.9 - # via a3m (pyproject.toml) -types-protobuf==4.24.0.20240311 - # via a3m (pyproject.toml) +types-lxml==2024.4.14 +types-protobuf==4.25.0.20240410 types-psycopg2==2.9.21.20240311 # via django-types -types-requests==2.31.0.20240311 - # via a3m (pyproject.toml) -typing-extensions==4.10.0 +types-requests==2.31.0.20240406 +typing-extensions==4.11.0 # via # django-stubs-ext # mypy # types-lxml unidecode==1.3.8 - # via a3m (pyproject.toml) urllib3==2.2.1 # via # botocore @@ -312,14 +268,6 @@ virtualenv==20.25.1 # pre-commit # tox vulture==2.11 - # via a3m (pyproject.toml) wheel==0.43.0 - # via - # a3m (pyproject.toml) - # pip-tools zipp==3.18.1 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/requirements.txt b/requirements.txt index a95d601d..1db56f33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,22 +1,15 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --output-file=requirements.txt pyproject.toml -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.12 --output-file=requirements.txt pyproject.toml ammcpc==0.2.0 - # via a3m (pyproject.toml) -asgiref==3.8.0 +asgiref==3.8.1 # via django attrs==23.2.0 # via # jsonschema # referencing bagit==1.8.1 - # via a3m (pyproject.toml) -boto3==1.34.67 - # via a3m (pyproject.toml) -botocore==1.34.67 +boto3==1.34.84 +botocore==1.34.84 # via # boto3 # s3transfer @@ -25,26 +18,17 @@ certifi==2024.2.2 charset-normalizer==3.3.2 # via requests click==8.1.7 - # via a3m (pyproject.toml) django==4.2.11 - # via - # a3m (pyproject.toml) - # django-stubs-ext + # via django-stubs-ext django-stubs-ext==4.2.7 - # via a3m (pyproject.toml) googleapis-common-protos==1.63.0 - # via - # a3m (pyproject.toml) - # grpcio-status + # via grpcio-status grpcio==1.62.1 # via - # a3m (pyproject.toml) # grpcio-reflection # grpcio-status grpcio-reflection==1.62.1 - # via a3m (pyproject.toml) grpcio-status==1.62.1 - # via a3m (pyproject.toml) idna==3.7 # via requests jmespath==1.0.1 @@ -52,12 +36,10 @@ jmespath==1.0.1 # boto3 # botocore jsonschema==4.21.1 - # via a3m (pyproject.toml) jsonschema-specifications==2023.12.1 # via jsonschema lxml==4.9.4 # via - # a3m (pyproject.toml) # ammcpc # metsrw markdown-it-py==3.0.0 @@ -65,18 +47,14 @@ markdown-it-py==3.0.0 mdurl==0.1.2 # via markdown-it-py metsrw==0.5.1 - # via a3m (pyproject.toml) platformdirs==4.2.0 - # via a3m (pyproject.toml) prometheus-client==0.20.0 - # via a3m (pyproject.toml) protobuf==4.25.3 # via # googleapis-common-protos # grpcio-reflection # grpcio-status pygfried==0.7.0 - # via a3m (pyproject.toml) pygments==2.17.2 # via rich python-dateutil==2.9.0.post0 @@ -86,9 +64,7 @@ referencing==0.34.0 # jsonschema # jsonschema-specifications requests==2.31.0 - # via a3m (pyproject.toml) rich==13.7.1 - # via a3m (pyproject.toml) rpds-py==0.18.0 # via # jsonschema @@ -97,14 +73,12 @@ s3transfer==0.10.1 # via boto3 six==1.16.0 # via python-dateutil -sqlparse==0.4.4 +sqlparse==0.5.0 # via django tenacity==8.2.3 - # via a3m (pyproject.toml) -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via django-stubs-ext unidecode==1.3.8 - # via a3m (pyproject.toml) urllib3==2.2.1 # via # botocore