Skip to content

[pre-commit.ci] pre-commit autoupdate #3196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 24, 2024
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.6.0
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.11.4"]
Expand All @@ -27,7 +27,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.12.1]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
rev: v0.1.14
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/cli/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ def _get_parser_doc() -> ToxParser:


__all__ = (
"get_options",
"Options",
"get_options",
)
2 changes: 1 addition & 1 deletion src/tox/config/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def add_core_arguments(parser: ArgumentParser) -> None:

__all__ = (
"DEFAULT_VERBOSITY",
"HelpFormatter",
"Parsed",
"ToxParser",
"HelpFormatter",
)
4 changes: 2 additions & 2 deletions src/tox/config/loader/ini/factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def is_negated(factor: str) -> bool:


__all__ = (
"filter_for_env",
"find_envs",
"expand_factors",
"extend_factors",
"filter_for_env",
"find_envs",
)
2 changes: 1 addition & 1 deletion src/tox/config/loader/ini/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ def replace_tty(args: list[str]) -> str:


__all__ = (
"find_replace_expr",
"MatchArg",
"MatchError",
"MatchExpression",
"find_replace_expr",
"replace",
)
4 changes: 2 additions & 2 deletions src/tox/config/of_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def __eq__(self, o: object) -> bool:


__all__ = [
"ConfigLoadArgs",
"ConfigConstantDefinition",
"ConfigDefinition",
"ConfigDynamicDefinition",
"ConfigConstantDefinition",
"ConfigLoadArgs",
]
4 changes: 2 additions & 2 deletions src/tox/config/source/ini_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def names(self) -> list[str]:
CORE = IniSection(None, "tox")

__all__ = [
"IniSection",
"CORE",
"TEST_ENV_PREFIX",
"PKG_ENV_PREFIX",
"TEST_ENV_PREFIX",
"IniSection",
]
2 changes: 1 addition & 1 deletion src/tox/execute/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ def out_err(self) -> tuple[str, str]:

__all__ = (
"ContentHandler",
"Outcome",
"Execute",
"ExecuteInstance",
"ExecuteOptions",
"ExecuteStatus",
"Outcome",
"StdinSource",
)
10 changes: 5 additions & 5 deletions src/tox/execute/local_sub_process/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def write_stdin(self, content: str) -> None:
try:
if sys.platform == "win32": # explicit check for mypy # pragma: win32 cover
# on Windows we have a PipeHandle object here rather than a file stream
import _overlapped # type: ignore[import] # noqa: PLC0415
import _overlapped # type: ignore[import] # noqa: PLC0415,PLC2701

ov = _overlapped.Overlapped(0)
ov.WriteFile(stdin.handle, bytes_content) # type: ignore[attr-defined]
Expand Down Expand Up @@ -219,9 +219,9 @@ def __enter__(self) -> ExecuteStatus:
status = LocalSubprocessExecuteStatus(self.options, self._out, self._err, process)
drain, pid = self._on_exit_drain, self.process.pid
self._read_stderr = ReadViaThread(stderr.send(process), self.err_handler, name=f"err-{pid}", drain=drain)
self._read_stderr.__enter__() # noqa: PLC2801
self._read_stderr.__enter__()
self._read_stdout = ReadViaThread(stdout.send(process), self.out_handler, name=f"out-{pid}", drain=drain)
self._read_stdout.__enter__() # noqa: PLC2801
self._read_stdout.__enter__()

if sys.platform == "win32": # explicit check for mypy: # pragma: win32 cover
process.stderr.read = self._read_stderr._drain_stream # type: ignore[assignment,union-attr] # noqa: SLF001
Expand Down Expand Up @@ -322,10 +322,10 @@ def _pty(key: str) -> tuple[int, int] | None:


__all__ = (
"SIG_INTERRUPT",
"CREATION_FLAGS",
"SIG_INTERRUPT",
"LocalSubProcessExecuteInstance",
"LocalSubProcessExecutor",
"LocalSubprocessExecuteStatus",
"LocalSubprocessExecuteFailedStatus",
"LocalSubprocessExecuteStatus",
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from time import sleep # pragma: win32 cover
from typing import Callable # pragma: win32 cover

import _overlapped # type: ignore[import] # pragma: win32 cover
import _overlapped # type: ignore[import] # pragma: win32 cover # noqa: PLC2701

from .read_via_thread import ReadViaThread # pragma: win32 cover

Expand Down
2 changes: 1 addition & 1 deletion src/tox/execute/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def shell_cmd(cmd: Sequence[str]) -> str:


__all__ = (
"StdinSource",
"ExecuteRequest",
"StdinSource",
"shell_cmd",
)
2 changes: 1 addition & 1 deletion src/tox/journal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def write_journal(path: Path | None, journal: Journal) -> None:


__all__ = (
"Journal",
"EnvJournal",
"Journal",
"write_journal",
)
8 changes: 4 additions & 4 deletions src/tox/plugin/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def tox_env_teardown(tox_env: ToxEnv) -> None: # noqa: ARG001

__all__ = [
"NAME",
"tox_register_tox_env",
"tox_add_option",
"tox_add_core_config",
"tox_add_env_config",
"tox_before_run_commands",
"tox_add_option",
"tox_after_run_commands",
"tox_on_install",
"tox_before_run_commands",
"tox_env_teardown",
"tox_on_install",
"tox_register_tox_env",
]
6 changes: 3 additions & 3 deletions src/tox/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, cast

import pytest
from _pytest.fixtures import SubRequest
from _pytest.fixtures import SubRequest # noqa: PLC2701
from devpi_process import IndexServer
from virtualenv.info import fs_supports_symlink

Expand Down Expand Up @@ -527,12 +527,12 @@ def register_inline_plugin(mocker: MockerFixture, *args: Callable[..., Any]) ->
__all__ = (
"CaptureFixture",
"LogCaptureFixture",
"TempPathFactory",
"MonkeyPatch",
"SubRequest",
"ToxRunOutcome",
"TempPathFactory",
"ToxProject",
"ToxProjectCreator",
"ToxRunOutcome",
"check_os_environ",
"register_inline_plugin",
)
4 changes: 2 additions & 2 deletions src/tox/session/cmd/run/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def run_command_set(


__all__ = (
"run_one",
"run_command_set",
"ToxEnvRunResult",
"run_command_set",
"run_one",
)
4 changes: 2 additions & 2 deletions src/tox/session/env_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def _mark_provision(self, on: bool, provision_tox_env: str) -> None: # noqa: FB


__all__ = [
"register_env_select_flags",
"EnvSelector",
"CliEnv",
"EnvSelector",
"register_env_select_flags",
]
2 changes: 1 addition & 1 deletion src/tox/tox_env/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, create_args: ToxEnvCreateArgs) -> None:

def __getattribute__(self, name: str) -> Any:
# the packaging class might be used by multiple environments in parallel, hold a lock for operations on it
obj = object.__getattribute__(self, name) # noqa: PLC2801
obj = object.__getattribute__(self, name)
if isinstance(obj, MethodType):
obj = _lock_method(self._thread_lock, self._file_lock, obj)
return obj
Expand Down
6 changes: 3 additions & 3 deletions src/tox/tox_env/python/pip/req/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Matches environment variable-style values in '${MY_VARIABLE_1}' with the variable name consisting of only uppercase
# letters, digits or the '_' (underscore). This follows the POSIX standard defined in IEEE Std 1003.1, 2013 Edition.
_ENV_VAR_RE = re.compile(r"(?P<var>\${(?P<name>[A-Z0-9_]+)})")
_SCHEME_RE = re.compile(r"^(http|https|file):", re.I)
_SCHEME_RE = re.compile(r"^(http|https|file):", re.IGNORECASE)
_COMMENT_RE = re.compile(r"(^|\s+)#.*$")
# https://www.python.org/dev/peps/pep-0508/#extras
_EXTRA_PATH = re.compile(r"(.*)\[([-._,\sa-zA-Z0-9]*)]")
Expand Down Expand Up @@ -484,7 +484,7 @@ def _option_to_args(self, opt: Namespace) -> list[str]: # noqa: C901, PLR0912,


__all__ = (
"RequirementsFile",
"ReqFileLines",
"ParsedRequirement",
"ReqFileLines",
"RequirementsFile",
)
2 changes: 1 addition & 1 deletion src/tox/tox_env/python/pip/req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ def factory(cls, root: Path, raw: object) -> PythonDeps:
}

__all__ = (
"PythonDeps",
"ONE_ARG",
"PythonDeps",
)
4 changes: 2 additions & 2 deletions src/tox/tox_env/python/virtual_env/package/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@

class ToxBackendFailed(Fail, BackendFailed):
def __init__(self, backend_failed: BackendFailed) -> None:
Fail.__init__(self) # noqa: PLC2801
Fail.__init__(self)
result: dict[str, Any] = {
"code": backend_failed.code,
"exc_type": backend_failed.exc_type,
"exc_msg": backend_failed.exc_msg,
}
BackendFailed.__init__( # noqa: PLC2801
BackendFailed.__init__(
self,
result,
backend_failed.out,
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def demo_pkg_inline_wheel(tmp_path_factory: pytest.TempPathFactory, demo_pkg_inl


def build_pkg(dist_dir: Path, of: Path, distributions: list[str], isolation: bool = True) -> Path:
from build.__main__ import build_package # noqa: PLC0415
from build.__main__ import build_package # noqa: PLC0415,PLC2701

build_package(str(of), str(dist_dir), distributions=distributions, isolation=isolation)
return next(dist_dir.iterdir())
Expand Down
2 changes: 1 addition & 1 deletion tests/session/test_env_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from tox.config.cli.parse import get_options
from tox.session.env_select import _DYNAMIC_ENV_FACTORS, CliEnv, EnvSelector
from tox.session.env_select import _DYNAMIC_ENV_FACTORS, CliEnv, EnvSelector # noqa: PLC2701
from tox.session.state import State

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion tests/util/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from tox.util.ci import _ENV_VARS, is_ci
from tox.util.ci import _ENV_VARS, is_ci # noqa: PLC2701


@pytest.mark.parametrize(
Expand Down