Skip to content
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

Add on platform constat to core #3315

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into on-platform
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Aug 5, 2024
commit 73bd97e02944b6c9edb4d63301f2aec35e10110d
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ lint.ignore = [
"D", # ignore documentation for now
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"DOC201", # broken with sphinx docs
"DOC501", # broken with sphinx docs
"INP001", # no implicit namespaces here
"ISC001", # conflicts with formatter
"PLR0914", ## Too many local variables
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/cli/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Customize argparse logic for tox (also contains the base options)."""
"""Customize argparse logic for tox (also contains the base options).""" # noqa: A005

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/loader/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __str__(self) -> str:
return f"{self.namespace}{'.' if self.namespace else ''}{self.key}={self.value}"

def __eq__(self, other: object) -> bool:
if type(self) != type(other):
if type(self) != type(other): # noqa: E721
return False
return (self.namespace, self.key, self.value) == (
other.namespace, # type: ignore[attr-defined]
Expand Down
6 changes: 3 additions & 3 deletions src/tox/config/of_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __call__(self, conf: Config, loaders: list[Loader[T]], args: ConfigLoadArgs)
raise NotImplementedError

def __eq__(self, o: object) -> bool:
return type(self) == type(o) and (self.keys, self.desc) == (o.keys, o.desc) # type: ignore[attr-defined]
return type(self) == type(o) and (self.keys, self.desc) == (o.keys, o.desc) # type: ignore[attr-defined] # noqa: E721

def __ne__(self, o: object) -> bool:
return not (self == o)
Expand All @@ -56,7 +56,7 @@ def __call__(
return self.value() if callable(self.value) else self.value

def __eq__(self, o: object) -> bool:
return type(self) == type(o) and super().__eq__(o) and self.value == o.value # type: ignore[attr-defined]
return type(self) == type(o) and super().__eq__(o) and self.value == o.value # type: ignore[attr-defined] # noqa: E721

def __repr__(self) -> str:
values = ((k, v) for k, v in vars(self).items() if v is not None)
Expand Down Expand Up @@ -120,7 +120,7 @@ def __repr__(self) -> str:

def __eq__(self, o: object) -> bool:
return (
type(self) == type(o)
type(self) == type(o) # noqa: E721
and super().__eq__(o)
and (self.of_type, self.default, self.post_process) == (o.of_type, o.default, o.post_process) # type: ignore[attr-defined]
)
Expand Down
6 changes: 3 additions & 3 deletions src/tox/config/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations # noqa: A005

from collections import OrderedDict
from typing import Iterator, Sequence
Expand Down Expand Up @@ -26,7 +26,7 @@ def __repr__(self) -> str:
return f"{type(self).__name__}(args={args!r})"

def __eq__(self, other: object) -> bool:
return type(self) == type(other) and (self.args, self.ignore_exit_code, self.invert_exit_code) == (
return type(self) == type(other) and (self.args, self.ignore_exit_code, self.invert_exit_code) == ( # noqa: E721
other.args, # type: ignore[attr-defined]
other.ignore_exit_code, # type: ignore[attr-defined]
other.invert_exit_code, # type: ignore[attr-defined]
Expand Down Expand Up @@ -56,7 +56,7 @@ def __repr__(self) -> str:
return f"{type(self).__name__}({self.envs!r})"

def __eq__(self, other: object) -> bool:
return type(self) == type(other) and self.envs == other.envs # type: ignore[attr-defined]
return type(self) == type(other) and self.envs == other.envs # type: ignore[attr-defined] # noqa: E721

def __ne__(self, other: object) -> bool:
return not (self == other)
Expand Down
5 changes: 3 additions & 2 deletions src/tox/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from contextlib import contextmanager
from io import BytesIO, TextIOWrapper
from pathlib import Path
from threading import Thread, current_thread, enumerate, local
from threading import Thread, current_thread, local
from threading import enumerate as enumerate_threads
from typing import IO, ClassVar, Iterator, Tuple

from colorama import Fore, Style, init
Expand Down Expand Up @@ -58,7 +59,7 @@ def name(self) -> str:
def name(self, value: str) -> None:
self._name = value

for ident in self._ident_to_data.keys() - {t.ident for t in enumerate()}:
for ident in self._ident_to_data.keys() - {t.ident for t in enumerate_threads()}:
self._ident_to_data.pop(ident)
self._ident_to_data[current_thread().ident] = value

Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/env_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __repr__(self) -> str:
return f"{self.__class__.__name__}({'' if self.is_default_list else repr(str(self))})"

def __eq__(self, other: object) -> bool:
return type(self) == type(other) and self._names == other._names # type: ignore[attr-defined]
return type(self) == type(other) and self._names == other._names # type: ignore[attr-defined] # noqa: E721

def __ne__(self, other: object) -> bool:
return not (self == other)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.