From 99c9818b0f1690c419dc18fe5f15921f4c7bd61d Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 17 Jun 2024 15:15:43 +0100 Subject: [PATCH] Correct minimum requirements Also adds pipeline to test with lower constraints --- .config/constraints.txt | 94 ++++++++++++++++++----------------- .config/dictionary.txt | 5 ++ .config/requirements-test.txt | 10 ++-- .config/requirements.txt | 18 +++---- .github/lower-constraints.txt | 16 ++++++ .github/workflows/tox.yml | 1 + .pre-commit-config.yaml | 37 ++++++++++++-- test/test_cli.py | 2 +- tox.ini | 28 +++++++---- 9 files changed, 139 insertions(+), 72 deletions(-) create mode 100644 .github/lower-constraints.txt diff --git a/.config/constraints.txt b/.config/constraints.txt index a6c066c..a2183a5 100644 --- a/.config/constraints.txt +++ b/.config/constraints.txt @@ -4,74 +4,78 @@ # # pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras pyproject.toml # -babel==2.14.0 +babel==2.15.0 +backports-tarfile==1.2.0 beautifulsoup4==4.12.3 -build==1.1.1 +build==1.2.1 cachetools==5.3.3 -cairocffi==1.6.1 +cairocffi==1.7.0 cairosvg==2.7.1 -certifi==2024.2.2 +certifi==2024.6.2 cffi==1.16.0 chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 -coverage==7.4.3 -cryptography==42.0.5 +coverage==7.5.3 +cryptography==42.0.8 cssselect2==0.7.0 defusedxml==0.7.1 diskcache==5.6.3 distlib==0.3.8 -docutils==0.20.1 -exceptiongroup==1.2.0 -filelock==3.13.1 +docutils==0.21.2 +exceptiongroup==1.2.1 +filelock==3.15.1 ghp-import==2.1.0 gitdb==4.0.11 -gitpython==3.1.42 -idna==3.6 -importlib-metadata==7.0.2 +gitpython==3.1.43 +idna==3.7 +importlib-metadata==7.1.0 iniconfig==2.0.0 -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 +jaraco-context==5.3.0 +jaraco-functools==4.0.1 jeepney==0.8.0 -jinja2==3.1.3 -keyring==24.3.1 -markdown==3.5.2 -markdown-exec==1.8.0 +jinja2==3.1.4 +keyring==25.2.1 +markdown==3.6 +markdown-exec==1.9.1 markdown-it-py==3.0.0 markupsafe==2.1.5 mdurl==0.1.2 mergedeep==1.3.4 -mkdocs==1.5.3 +mkdocs==1.6.0 mkdocs-autorefs==1.0.1 mkdocs-gen-files==0.5.0 -mkdocs-htmlproofer-plugin==1.2.0 -mkdocs-material==9.5.13 +mkdocs-get-deps==0.2.0 +mkdocs-htmlproofer-plugin==1.2.1 +mkdocs-material==9.5.27 mkdocs-material-extensions==1.3.1 -more-itertools==10.2.0 -nh3==0.2.15 -packaging==23.2 +more-itertools==10.3.0 +nh3==0.2.17 +packaging==24.1 paginate==0.5.6 pathspec==0.12.1 -pillow==10.2.0 -pipdeptree==2.16.1 -pkginfo==1.10.0 -platformdirs==4.2.0 -pluggy==1.4.0 +pillow==10.3.0 +pipdeptree==2.22.0 +pkginfo==1.11.1 +platformdirs==4.2.2 +pluggy==1.5.0 py-cpuinfo==9.0.0 -pycparser==2.21 -pygments==2.17.2 -pymdown-extensions==10.7.1 +pycparser==2.22 +pygments==2.18.0 +pymdown-extensions==10.8.1 pyproject-api==1.6.1 -pyproject-hooks==1.0.0 -pytest==8.1.1 +pyproject-hooks==1.1.0 +pytest==8.2.2 pytest-benchmark==4.0.0 -pytest-plus==0.6.1 +pytest-plus==0.7.0 python-dateutil==2.9.0.post0 pyyaml==6.0.1 pyyaml-env-tag==0.1 readme-renderer==43.0 -regex==2023.12.25 -requests==2.31.0 +regex==2024.5.15 +requests==2.32.3 requests-toolbelt==1.0.0 rfc3986==2.0.0 rich==13.7.1 @@ -81,17 +85,17 @@ six==1.16.0 smmap==5.0.1 soupsieve==2.5 subprocess-tee==0.4.1 -tinycss2==1.2.1 +tinycss2==1.3.0 tomli==2.0.1 ; python_version < "3.11" -tox==4.14.1 -twine==5.0.0 -typer==0.9.0 -typing-extensions==4.10.0 -urllib3==2.2.1 -virtualenv==20.25.1 -watchdog==4.0.0 +tox==4.15.1 +twine==5.1.0 +typer==0.12.3 +typing-extensions==4.12.2 +urllib3==2.2.2 +virtualenv==20.26.2 +watchdog==4.0.1 webencodings==0.5.1 -zipp==3.17.0 +zipp==3.19.2 # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/.config/dictionary.txt b/.config/dictionary.txt index d3a22bf..b81247d 100644 --- a/.config/dictionary.txt +++ b/.config/dictionary.txt @@ -10,6 +10,7 @@ Sorin autorefs basepython cairosvg +clib codenotify codespell configfile @@ -49,7 +50,10 @@ pymdown pymdownx pypa pypackage +resolvelib +ruamel setenv +shellingham showconfig showlocals ssbarnea @@ -62,3 +66,4 @@ toxinidir typer typeshed usedevelop +wcmatch diff --git a/.config/requirements-test.txt b/.config/requirements-test.txt index f5c4fba..26a1945 100644 --- a/.config/requirements-test.txt +++ b/.config/requirements-test.txt @@ -1,5 +1,5 @@ -coverage -pytest -pytest-benchmark -pytest-plus -tox>=4.0.0 +coverage>=7.5.3 +pytest>=8.0.0 +pytest-benchmark>=4.0.0 +pytest-plus>=0.7.0 +tox>=4.2.4 # older version can fail to exit when calling --showconfig diff --git a/.config/requirements.txt b/.config/requirements.txt index ebd637e..4e276fc 100644 --- a/.config/requirements.txt +++ b/.config/requirements.txt @@ -1,13 +1,13 @@ -GitPython build>=0.3.1.post1 # py_package -diskcache >= 5.2.1 -packaging +diskcache>=5.2.1 +gitpython>=3.1.26 +packaging>=22 # pytest, tox, build pip>=21.0.1 # py_package -pluggy -rich >= 9.0 +pluggy>=1.5.0 # typer and pytest indirect +rich>=10.11.0 # typer indirect setuptools # py_package due to running setup.py -shellingham -subprocess-tee >= 0.3.1 -tomli >= 1.1.0 ; python_version < "3.11" +shellingham>=1.5.4 +subprocess-tee>=0.4.1 +tomli>=2.0.1 ; python_version < "3.11" # tox twine>=3.4.1 # py_package -typer +typer>=0.12.2 # completion tests will fail with older diff --git a/.github/lower-constraints.txt b/.github/lower-constraints.txt new file mode 100644 index 0000000..233ed9d --- /dev/null +++ b/.github/lower-constraints.txt @@ -0,0 +1,16 @@ +# This file is kept in a different directory than .config in order to not be +# automatically updated by dependabot. This should be kept in sync with +# minimal requirements configured inside .config/requirements.in +build==0.3.1.post1 # py_package +diskcache==5.2.1 +gitpython==3.1.26 +packaging==22 +pip==23.2 # py_package (before installation might fail, including with tox) +pluggy==1.5.0 +rich==10.11.0 # typer indirect +setuptools # py_package due to running setup.py +shellingham==1.5.4 +subprocess-tee==0.4.1 +tomli >= 2.0.1 ; python_version < "3.11" # tox v4 +twine==3.4.1 # py_package +typer==0.12.2 diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 53a7c7a..e5fd3f4 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -36,6 +36,7 @@ jobs: docs integration pkg + lower platforms: linux,macos build: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d95272..f82cd59 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,8 @@ --- +ci: + skip: + - lock + - deps repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.9 @@ -72,17 +76,44 @@ repos: - packaging - rich - subprocess-tee - - typer>=0.7.0 + - typer>=0.12.2 - repo: https://github.com/pycqa/pylint rev: v3.2.3 hooks: - id: pylint additional_dependencies: - - GitPython + - gitpython - click-help-colors - diskcache - importlib-metadata - pytest - rich - subprocess-tee - - typer>=0.7.0 + - typer>=0.12.2 + - repo: https://github.com/jazzband/pip-tools + rev: 7.4.1 + hooks: + - id: pip-compile + name: lock + alias: lock + always_run: true + entry: pip-compile -q --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --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 + - id: pip-compile + name: deps + alias: deps + always_run: true + entry: pip-compile -q --no-annotate --output-file=.config/constraints.txt pyproject.toml --all-extras --strip-extras --upgrade + files: ^.config\/.*requirements.*$ + language: python + language_version: "3.10" # minimal we support officially + pass_filenames: false + stages: [manual] + additional_dependencies: + - pip>=22.3.1 diff --git a/test/test_cli.py b/test/test_cli.py index 9370eea..ccbc672 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -52,7 +52,7 @@ def do_complete() -> int | None: assert result == 0 assert benchmark.stats["min"] > 0.0001 # seconds - assert benchmark.stats["mean"] < 0.01 # seconds + assert benchmark.stats["mean"] < 0.02 # seconds @pytest.mark.parametrize( diff --git a/tox.ini b/tox.ini index 95d6a4d..af8e0ea 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,16 @@ envlist = docs pkg py + lower integration -minversion = 4.11.3 +minversion = 4.15.1 isolated_build = true -skip_missing_interpreters = false +skip_missing_interpreters = true requires = - tox >= 4.6.3 + tox >= 4.15.1 tox-extra setuptools >= 65.3.0 # editable installs + pip >= 24.0 [testenv] description = Run the tests with pytest @@ -63,22 +65,29 @@ setenv = allowlist_externals = bash + find rm sh package = editable +[testenv:lower] +description = Install using lower-constraints.txt file for testing oldest versions. +setenv = + PIP_CONSTRAINT = {toxinidir}/.github/lower-constraints.txt +commands_post = + pip --version + pip check + pip freeze + [testenv:deps] description = Update dependency lock files -# Force it to use oldest supported version of python or we would lose ability -# to get pinning correctly. -basepython = python3.10 skip_install = true deps = - pip-tools >= 6.12.3 + {[testenv:lint]deps} setenv = PIP_CONSTRAINT= commands = - pip-compile --upgrade --no-annotate --strip-extras --output-file=.config/constraints.txt --all-extras pyproject.toml + pre-commit run --all-files --show-diff-on-failure --hook-stage manual deps [testenv:docs] description = Builds docs @@ -110,7 +119,8 @@ skip_install = true setenv = PIP_CONSTRAINT= commands = - python -m pre_commit run {tty:--color=always} --all-files --show-diff-on-failure + pre-commit run {tty:--color=always} --all-files --show-diff-on-failure + pre-commit run --all-files --show-diff-on-failure --hook-stage manual lock [testenv:integration] description = Run integrations tests