Skip to content

Commit

Permalink
Correct minimum requirements
Browse files Browse the repository at this point in the history
Also adds pipeline to test with lower constraints
  • Loading branch information
ssbarnea committed Jun 17, 2024
1 parent 48e9ed9 commit 99c9818
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 72 deletions.
94 changes: 49 additions & 45 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Sorin
autorefs
basepython
cairosvg
clib
codenotify
codespell
configfile
Expand Down Expand Up @@ -49,7 +50,10 @@ pymdown
pymdownx
pypa
pypackage
resolvelib
ruamel
setenv
shellingham
showconfig
showlocals
ssbarnea
Expand All @@ -62,3 +66,4 @@ toxinidir
typer
typeshed
usedevelop
wcmatch
10 changes: 5 additions & 5 deletions .config/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions .config/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions .github/lower-constraints.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
docs
integration
pkg
lower
platforms: linux,macos
build:
Expand Down
37 changes: 34 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
ci:
skip:
- lock
- deps
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
28 changes: 19 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 99c9818

Please sign in to comment.