From d76a1102f97b50bc77237771dd474637d5884086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 28 Aug 2023 07:46:12 -0700 Subject: [PATCH] Fix type checker (#50) --- .github/workflows/check.yml | 3 +-- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 13 ++++++------- src/pytest_env/plugin.py | 2 +- tox.ini | 9 +-------- 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bb4ed1e..9f0b667 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,12 +18,11 @@ jobs: fail-fast: false matrix: py: - - "3.12.0-beta.2" + - "3.12.0-rc.1" - "3.11" - "3.10" - "3.9" - "3.8" - - "3.7" os: - ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9cee28..3d44061 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.0.285" + rev: "v0.0.286" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -19,10 +19,10 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "0.13.1" + rev: "1.1.0" hooks: - id: pyproject-fmt - additional_dependencies: ["tox>=4.6"] + additional_dependencies: ["tox>=4.10"] - repo: https://github.com/pre-commit/mirrors-prettier rev: "v3.0.2" hooks: diff --git a/pyproject.toml b/pyproject.toml index 9d20153..f86ce30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.3", - "hatchling>=1.17.1", + "hatchling>=1.18", ] [project] @@ -15,7 +15,7 @@ keywords = [ ] license.file = "LICENSE" maintainers = [{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }] -requires-python = ">=3.7" +requires-python = ">=3.8" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -23,7 +23,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -36,11 +35,11 @@ dynamic = [ "version", ] dependencies = [ - "pytest>=7.3.1", + "pytest>=7.4", ] optional-dependencies.test = [ - "coverage>=7.2.7", - "pytest-mock>=3.10", + "coverage>=7.3", + "pytest-mock>=3.11.1", ] urls.Homepage = "https://github.com/pytest-dev/pytest-env" urls.Source = "https://github.com/pytest-dev/pytest-env" @@ -58,7 +57,7 @@ line-length = 120 [tool.ruff] select = ["ALL"] line-length = 120 -target-version = "py37" +target-version = "py38" isort = {known-first-party = ["pytest_env"], required-imports = ["from __future__ import annotations"]} ignore = [ "ANN101", # no type annotation for self diff --git a/src/pytest_env/plugin.py b/src/pytest_env/plugin.py index 59a775b..be7a5e5 100644 --- a/src/pytest_env/plugin.py +++ b/src/pytest_env/plugin.py @@ -12,7 +12,7 @@ def pytest_addoption(parser: pytest.Parser) -> None: parser.addini("env", type="linelist", help=help_msg, default=[]) -@pytest.hookimpl(tryfirst=True) # type: ignore[misc] +@pytest.hookimpl(tryfirst=True) def pytest_load_initial_conftests( args: list[str], # noqa: ARG001 early_config: pytest.Config, diff --git a/tox.ini b/tox.ini index 5edbea1..e743352 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,6 @@ env_list = py310 py39 py38 - py37 type readme skip_missing_interpreters = true @@ -44,7 +43,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.3 + mypy==1.5.1 set_env = {tty:MYPY_FORCE_COLOR = 1} commands = @@ -70,9 +69,3 @@ extras = commands = python -m pip list --format=columns python -c 'import sys; print(sys.executable)' - -[flake8] -max-complexity = 22 -max-line-length = 120 -noqa-require-code = true -dictionaries = en_US,python,technical,django