Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.11.0-rc.1"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Setup python for tox
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down Expand Up @@ -81,10 +81,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python 3.10
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install self-tox
run: python -m pip install .
- name: Run check for ${{ matrix.tox_env }}
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Setup python to build package
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install build
run: python -m pip install build
- uses: actions/checkout@v3
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
rev: v2.3.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.2.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
Expand All @@ -29,15 +29,15 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
args: [--safe]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.8]
additional_dependencies: [black==22.10]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
Expand All @@ -52,15 +52,15 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==22.8.23
- flake8-comprehensions==3.10
- flake8-bugbear==22.10.27
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
- flake8-spellcheck==0.28
- flake8-unused-arguments==0.0.11
- flake8-unused-arguments==0.0.12
- flake8-noqa==1.2.9
- pep8-naming==0.13.2
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
additional_dependencies:
Expand Down
8 changes: 4 additions & 4 deletions .readthedocs.yaml → .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: 2
build:
image: latest
formats:
- htmlzip
os: ubuntu-22.04
tools:
python: "3"
python:
version: 3.8
install:
- method: pip
path: .
Expand All @@ -13,3 +12,4 @@ python:
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true
38 changes: 19 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling>=1.8.1", "hatch-vcs>=0.2"]
requires = ["hatchling>=1.11.1", "hatch-vcs>=0.2"]

[project]
name = "tox"
Expand All @@ -23,42 +23,42 @@ requires-python = ">=3.7"
dependencies = [
"cachetools>=5.2",
"chardet>=5",
"colorama>=0.4.5",
"colorama>=0.4.6",
"packaging>=21.3",
"platformdirs>=2.5.2",
"pluggy>=1",
"pyproject-api>=0.1.1",
'tomli>=2.0.1;python_version<"3.11"',
"virtualenv>=20.16.5",
'importlib-metadata>=4.12; python_version < "3.8"',
'typing-extensions>=4.3; python_version < "3.8"',
"pyproject-api>=1.1.1",
'tomli>=2.0.1; python_version < "3.11"',
"virtualenv>=20.16.6",
'importlib-metadata>=5; python_version < "3.8"',
'typing-extensions>=4.4; python_version < "3.8"',
]
optional-dependencies.docs = [
"furo>=2022.6.21",
"sphinx>=5.1.1",
"furo>=2022.9.29",
"sphinx>=5.3",
"sphinx-argparse-cli>=1.10",
"sphinx-autodoc-typehints>=1.19.2",
"sphinx-autodoc-typehints>=1.19.4",
"sphinx-copybutton>=0.5",
"sphinx-inline-tabs>=2022.1.2b11",
"sphinxcontrib-towncrier>=0.2.1a0",
"towncrier>=22.8",
]
optional-dependencies.testing = [
"covdefaults>=2.2",
"devpi-client>=6.0.1",
"devpi-server>=6.6",
"devpi-client>=6.0.2",
"devpi-server>=6.7",
"distlib>=0.3.6",
"filelock>=3.8",
"flaky>=3.7",
"hatch-vcs>=0.2",
"hatchling>=1.8.1",
"psutil>=5.9.2",
"pytest>=7.1.3",
"pytest-cov>=3",
"pytest-mock>=3.8.2",
"pytest-xdist>=2.5",
"hatchling>=1.11.1",
"psutil>=5.9.3",
"pytest>=7.2",
"pytest-cov>=4",
"pytest-mock>=3.10",
"pytest-xdist>=3.0.2",
"re-assert>=1.1",
"time-machine>=2.8.1",
"time-machine>=2.8.2",
]
scripts.tox = "tox.run:run"
dynamic = ["version"]
Expand Down
13 changes: 6 additions & 7 deletions src/tox/config/loader/memory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING, Any, Iterator, TypeVar, cast
from typing import TYPE_CHECKING, Any, Iterator

from tox.config.types import Command, EnvList

Expand All @@ -11,16 +11,15 @@

if TYPE_CHECKING:
from tox.config.main import Config
T = TypeVar("T")


class MemoryLoader(Loader[Any]):
def __init__(self, **kwargs: Any) -> None:
super().__init__(Section(prefix="<memory>", name=str(id(self))), [])
self.raw: dict[str, Any] = {**kwargs}

def load_raw(self, key: Any, conf: Config | None, env_name: str | None) -> T: # noqa: U100
return cast(T, self.raw[key])
def load_raw(self, key: Any, conf: Config | None, env_name: str | None) -> Any: # noqa: U100
return self.raw[key]

def found_keys(self) -> set[str]:
return set(self.raw.keys())
Expand All @@ -34,15 +33,15 @@ def to_str(value: Any) -> str:
return str(value)

@staticmethod
def to_list(value: Any, of_type: type[Any]) -> Iterator[T]: # noqa: U100
def to_list(value: Any, of_type: type[Any]) -> Iterator[Any]: # noqa: U100
return iter(value)

@staticmethod
def to_set(value: Any, of_type: type[Any]) -> Iterator[T]: # noqa: U100
def to_set(value: Any, of_type: type[Any]) -> Iterator[Any]: # noqa: U100
return iter(value)

@staticmethod
def to_dict(value: Any, of_type: tuple[type[Any], type[Any]]) -> Iterator[tuple[T, T]]: # noqa: U100
def to_dict(value: Any, of_type: tuple[type[Any], type[Any]]) -> Iterator[tuple[Any, Any]]: # noqa: U100
return value.items() # type: ignore[no-any-return]

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion src/tox/journal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def write_journal(path: Path | None, journal: Journal) -> None:
if path is None:
return
with open(path, "wt") as file_handler:
with open(path, "w") as file_handler:
json.dump(journal.content, file_handler, indent=2, ensure_ascii=False)


Expand Down
2 changes: 1 addition & 1 deletion src/tox/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def stderr(self) -> TextIOWrapper:
return self._local.out_err[1]

@property # type: ignore[override]
def stream(self) -> IO[str]: # type: ignore[override]
def stream(self) -> IO[str]:
""":return: the current stream to write to (alias for the current standard output)"""
return self.stdout

Expand Down
6 changes: 3 additions & 3 deletions src/tox/tox_env/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def teardown(self) -> None:
finally:
self._run_state["teardown"] = True

def _teardown(self) -> None:
def _teardown(self) -> None: # noqa: B027 # empty abstract base class
pass

def _platform_check(self) -> None:
Expand All @@ -270,10 +270,10 @@ def _setup_env(self) -> None:
raise Recreate(f"env type changed from {old} to {conf}")
self._handle_env_tmp_dir()

def _setup_with_env(self) -> None:
def _setup_with_env(self) -> None: # noqa: B027 # empty abstract base class
pass

def _done_with_setup(self) -> None:
def _done_with_setup(self) -> None: # noqa: B027 # empty abstract base class
"""called when setup is done"""

def _handle_env_tmp_dir(self) -> None:
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ description = run type check on code base
setenv =
{tty:MYPY_FORCE_COLOR = 1}
deps =
mypy==0.971
mypy==0.982
types-cachetools>=5.2.1
types-chardet>=5.0.4
commands =
Expand All @@ -76,8 +76,8 @@ commands =
description = check that the long description is valid
skip_install = true
deps =
build[virtualenv]>=0.8
check-wheel-contents>=0.3.4
build[virtualenv]>=0.9
check-wheel-contents>=0.4
twine>=4.0.1
commands =
python -m build -o {envtmpdir} -s -w .
Expand All @@ -88,7 +88,7 @@ commands =
description = do a release, required posarg of the version number
skip_install = true
deps =
gitpython>=3.1.27
gitpython>=3.1.29
packaging>=21.3
towncrier>=22.8
commands =
Expand Down