diff --git a/Makefile b/Makefile index 40e4be7..00839e0 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,24 @@ install: pip install -r requirements/all.txt pip install -e . +.PHONY: refresh-lockfiles +refresh-lockfiles: + @echo "Updating requirements/*.txt files using pip-compile" + find requirements/ -name '*.txt' ! -name 'all.txt' -type f -delete + pip-compile -q --no-emit-index-url --resolver backtracking -o requirements/linting.txt requirements/linting.in + pip-compile -q --no-emit-index-url --resolver backtracking -o requirements/testing.txt requirements/testing.in + pip-compile -q --no-emit-index-url --resolver backtracking --extra toml --extra yaml -o requirements/pyproject.txt pyproject.toml + pip install --dry-run -r requirements/all.txt + .PHONY: format format: - black $(sources) - ruff --fix $(sources) + ruff check --fix $(sources) + ruff format $(sources) .PHONY: lint lint: - ruff $(sources) - black $(sources) --check --diff + ruff check $(sources) + ruff format --check $(sources) .PHONY: mypy mypy: diff --git a/pyproject.toml b/pyproject.toml index 1b3b0a5..1d9eb19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,17 +85,20 @@ source = [ [tool.ruff] line-length = 120 +target-version = 'py38' + +[tool.ruff.lint.pyupgrade] +keep-runtime-typing = true + +[tool.ruff.lint] extend-select = ['Q', 'RUF100', 'C90', 'UP', 'I'] flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'} -mccabe = { max-complexity = 14 } isort = { known-first-party = ['pydantic_settings', 'tests'] } -target-version = 'py38' +mccabe = { max-complexity = 14 } +pydocstyle = { convention = 'google' } -[tool.black] -color = true -line-length = 120 -target-version = ['py310'] -skip-string-normalization = true +[tool.ruff.format] +quote-style = 'single' [tool.mypy] python_version = '3.10' diff --git a/requirements/linting.txt b/requirements/linting.txt index df6d96c..17dbd33 100644 --- a/requirements/linting.txt +++ b/requirements/linting.txt @@ -2,9 +2,9 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --output-file=requirements/linting.txt requirements/linting.in +# pip-compile --no-emit-index-url --output-file=requirements/linting.txt requirements/linting.in # -black==24.2.0 +black==24.4.0 # via -r requirements/linting.in cfgv==3.4.0 # via pre-commit @@ -12,11 +12,11 @@ click==8.1.7 # via black distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.13.4 # via virtualenv -identify==2.5.34 +identify==2.5.36 # via pre-commit -mypy==1.8.0 +mypy==1.9.0 # via -r requirements/linting.in mypy-extensions==1.0.0 # via @@ -24,7 +24,7 @@ mypy-extensions==1.0.0 # mypy nodeenv==1.8.0 # via pre-commit -packaging==23.2 +packaging==24.0 # via black pathspec==0.12.1 # via black @@ -34,13 +34,13 @@ platformdirs==4.2.0 # virtualenv pre-commit==3.5.0 # via -r requirements/linting.in -pyupgrade==3.15.0 +pyupgrade==3.15.2 # via -r requirements/linting.in pyyaml==6.0.1 # via # -r requirements/linting.in # pre-commit -ruff==0.2.2 +ruff==0.4.1 # via -r requirements/linting.in tokenize-rt==5.2.0 # via pyupgrade @@ -48,13 +48,13 @@ tomli==2.0.1 # via # black # mypy -types-pyyaml==6.0.12.12 +types-pyyaml==6.0.12.20240311 # via -r requirements/linting.in -typing-extensions==4.9.0 +typing-extensions==4.11.0 # via # black # mypy -virtualenv==20.25.0 +virtualenv==20.25.3 # via pre-commit # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index 9b35b3e..b27b51c 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --extra=toml --extra=yaml,toml --output-file=requirements/pyproject.txt pyproject.toml +# pip-compile --extra=toml --extra=yaml --no-emit-index-url --output-file=requirements/pyproject.txt pyproject.toml # annotated-types==0.6.0 # via pydantic @@ -16,7 +16,8 @@ pyyaml==6.0.1 # via pydantic-settings (pyproject.toml) tomli==2.0.1 # via pydantic-settings (pyproject.toml) -typing-extensions==4.9.0 +typing-extensions==4.11.0 # via + # annotated-types # pydantic # pydantic-core diff --git a/requirements/testing.txt b/requirements/testing.txt index 84dc8da..f38ba45 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -2,15 +2,15 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --output-file=requirements/testing.txt requirements/testing.in +# pip-compile --no-emit-index-url --output-file=requirements/testing.txt requirements/testing.in # -black==24.2.0 +black==24.4.0 # via pytest-examples click==8.1.7 # via black -coverage[toml]==7.4.1 +coverage[toml]==7.4.4 # via -r requirements/testing.in -exceptiongroup==1.2.0 +exceptiongroup==1.2.1 # via pytest iniconfig==2.0.0 # via pytest @@ -20,7 +20,7 @@ mdurl==0.1.2 # via markdown-it-py mypy-extensions==1.0.0 # via black -packaging==23.2 +packaging==24.0 # via # black # pytest @@ -28,11 +28,11 @@ pathspec==0.12.1 # via black platformdirs==4.2.0 # via black -pluggy==1.4.0 +pluggy==1.5.0 # via pytest pygments==2.17.2 # via rich -pytest==8.0.1 +pytest==8.1.1 # via # -r requirements/testing.in # pytest-examples @@ -40,20 +40,20 @@ pytest==8.0.1 # pytest-pretty pytest-examples==0.0.10 # via -r requirements/testing.in -pytest-mock==3.12.0 +pytest-mock==3.14.0 # via -r requirements/testing.in pytest-pretty==1.2.0 # via -r requirements/testing.in -rich==13.7.0 +rich==13.7.1 # via pytest-pretty -ruff==0.2.2 +ruff==0.4.1 # via pytest-examples tomli==2.0.1 # via # black # coverage # pytest -typing-extensions==4.9.0 +typing-extensions==4.11.0 # via # black # rich