diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6429c5e0..0380fddb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black args: [--safe] @@ -34,13 +34,13 @@ repos: rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==23.1] + additional_dependencies: [black==23.3] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: - id: rst-backticks - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "0.6.1" + rev: "1.0.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -53,7 +53,7 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==23.3.12 + - flake8-bugbear==23.3.23 - flake8-comprehensions==3.11.1 - flake8-pytest-style==1.7.2 - flake8-spellcheck==0.28 diff --git a/pyproject.toml b/pyproject.toml index 3ea4ea01..903acccf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dynamic = [ "version", ] optional-dependencies.docs = [ - "furo>=2022.12.7", + "furo>=2023.3.27", "sphinx>=6.1.3", "sphinx-autodoc-typehints!=1.23.4,>=1.22", ] diff --git a/tox.ini b/tox.ini index 602700f0..277e341b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,5 @@ [tox] +minversion = 4 envlist = fix py311 @@ -13,16 +14,17 @@ envlist = readme isolated_build = true skip_missing_interpreters = true -minversion = 4 [testenv] description = run tests with {basepython} +package = wheel +wheel_build_env = .pkg +extras = + testing passenv = PYTEST_* setenv = COVERAGE_FILE = {toxworkdir}{/}.coverage.{envname} -extras = - testing commands = pytest {tty:--color=yes} {posargs: \ --junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}filelock --cov {toxinidir}{/}tests \ @@ -30,37 +32,31 @@ commands = --cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \ tests} diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}{/}coverage.{envname}.xml -package = wheel -wheel_build_env = .pkg [testenv:fix] description = format the code base to adhere to our styles, and complain about what we cannot do automatically -passenv = - * basepython = python3.10 skip_install = true deps = - pre-commit>=3.2 + pre-commit>=3.2.1 +passenv = + * commands = pre-commit run --all-files --show-diff-on-failure python -c 'import pathlib; print("hint: run \{\} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))' [testenv:type] description = run type check on code base -setenv = - {tty:MYPY_FORCE_COLOR = 1} deps = mypy==1.1.1 +setenv = + {tty:MYPY_FORCE_COLOR = 1} commands = mypy --strict src/filelock mypy --strict tests [testenv:coverage] description = combine coverage files and generate diff (against DIFF_AGAINST defaulting to origin/main) -passenv = - DIFF_AGAINST -setenv = - COVERAGE_FILE = {toxworkdir}/.coverage skip_install = true deps = covdefaults>=2.3 @@ -68,6 +64,10 @@ deps = diff-cover>=7.5 extras = parallel_show_output = true +passenv = + DIFF_AGAINST +setenv = + COVERAGE_FILE = {toxworkdir}/.coverage commands = coverage combine coverage report --skip-covered --show-missing @@ -75,11 +75,11 @@ commands = coverage html -d {toxworkdir}/htmlcov diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml depends = - py311 py310 - py39 - py38 + py311 py37 + py38 + py39 pypy3 [testenv:docs]