From a097ba0d44e785b0f39a19af1cf91864b3fecc45 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sun, 29 Sep 2024 02:39:12 -0400 Subject: [PATCH 1/2] chore: include 3.13 in classifiers --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c91be0f4..9f91ac69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Testing", ] dependencies = [ From 269d424418b78cb78829de82484035abdaca89a1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sun, 29 Sep 2024 02:51:03 -0400 Subject: [PATCH 2/2] chore: pre-commit version bumps Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 10 +++---- CODE_OF_CONDUCT.md | 2 +- nox/_decorators.py | 2 +- nox/_option_set.py | 6 ++--- nox/manifest.py | 4 +-- nox/registry.py | 6 ++--- nox/virtualenv.py | 2 +- pyproject.toml | 60 ++++++++++++++++++++--------------------- 8 files changed, 45 insertions(+), 47 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72e48e79..1f4d45f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -19,19 +19,19 @@ repos: - id: trailing-whitespace - repo: https://github.com/tox-dev/pyproject-fmt - rev: "1.3.0" + rev: "2.2.4" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.6.8 hooks: - id: ruff args: ["--fix", "--show-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.11.2 hooks: - id: mypy files: ^nox/ @@ -44,7 +44,7 @@ repos: - uv - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9c0865ad..12d19bc6 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal +level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards diff --git a/nox/_decorators.py b/nox/_decorators.py index 25f13de6..86fc082d 100644 --- a/nox/_decorators.py +++ b/nox/_decorators.py @@ -51,7 +51,7 @@ def _copy_func(src: T, name: str | None = None) -> T: closure=src.__closure__, ) dst.__dict__.update(copy.deepcopy(src.__dict__)) - dst = functools.update_wrapper(dst, src) + dst = functools.update_wrapper(dst, src) # type: ignore[assignment] dst.__kwdefaults__ = src.__kwdefaults__ return cast(T, dst) diff --git a/nox/_option_set.py b/nox/_option_set.py index 0ade4ed0..ef989d7a 100644 --- a/nox/_option_set.py +++ b/nox/_option_set.py @@ -205,9 +205,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.parser_args = args self.parser_kwargs = kwargs self.options: collections.OrderedDict[str, Option] = collections.OrderedDict() - self.groups: collections.OrderedDict[ - str, OptionGroup - ] = collections.OrderedDict() + self.groups: collections.OrderedDict[str, OptionGroup] = ( + collections.OrderedDict() + ) def add_options(self, *args: Option) -> None: """Adds a sequence of Options to the OptionSet. diff --git a/nox/manifest.py b/nox/manifest.py index 63e55148..093d80e4 100644 --- a/nox/manifest.py +++ b/nox/manifest.py @@ -319,7 +319,7 @@ def notify( # Locate the session in the list of all sessions, and place it at # the end of the queue. for s in self._all_sessions: - if s == session or s.name == session or session in s.signatures: + if s == session or s.name == session or session in s.signatures: # noqa: PLR1714 if posargs is not None: s.posargs = list(posargs) self._queue.append(s) @@ -354,7 +354,7 @@ def __len__(self) -> int: def keyword_match(expression: str, keywords: Iterable[str]) -> Any: """See if an expression matches the given set of keywords.""" locals = KeywordLocals(set(keywords)) - return eval(expression, {}, locals) # noqa: PGH001 + return eval(expression, {}, locals) def _null_session_func_(session: Session) -> None: diff --git a/nox/registry.py b/nox/registry.py index 4e5c72aa..9d900e80 100644 --- a/nox/registry.py +++ b/nox/registry.py @@ -29,8 +29,7 @@ @overload -def session_decorator(__func: F) -> F: - ... +def session_decorator(__func: F) -> F: ... @overload @@ -45,8 +44,7 @@ def session_decorator( tags: Sequence[str] | None = ..., *, default: bool = ..., -) -> Callable[[F], F]: - ... +) -> Callable[[F], F]: ... def session_decorator( diff --git a/nox/virtualenv.py b/nox/virtualenv.py index adf60333..0c718cd3 100644 --- a/nox/virtualenv.py +++ b/nox/virtualenv.py @@ -449,7 +449,7 @@ def _check_reused_environment_type(self) -> bool: return True # Switching to "uv" is safe, but not the other direction (no pip) - if old_env in {"virtualenv", "venv"} and self.venv_backend == "uv": + if old_env in {"virtualenv", "venv"} and self.venv_backend == "uv": # noqa: SIM103 return True return False diff --git a/pyproject.toml b/pyproject.toml index 9f91ac69..5a41fefe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,49 +40,46 @@ classifiers = [ "Topic :: Software Development :: Testing", ] dependencies = [ - "argcomplete<4.0,>=1.9.4", - "colorlog<7.0.0,>=2.6.1", + "argcomplete<4,>=1.9.4", + "colorlog<7,>=2.6.1", "packaging>=20.9", - 'tomli>=1; python_version < "3.11"', + "tomli>=1; python_version<'3.11'", "virtualenv>=20.14.1", ] -[project.optional-dependencies] -tox_to_nox = [ +optional-dependencies.tox_to_nox = [ "jinja2", "tox", ] -uv = [ +optional-dependencies.uv = [ "uv>=0.1.6", ] -[project.urls] -bug-tracker = "https://github.com/wntrblm/nox/issues" -documentation = "https://nox.thea.codes" -homepage = "https://github.com/wntrblm/nox" -repository = "https://github.com/wntrblm/nox" -[project.scripts] -nox = "nox.__main__:main" -tox-to-nox = "nox.tox_to_nox:main" +urls.bug-tracker = "https://github.com/wntrblm/nox/issues" +urls.documentation = "https://nox.thea.codes" +urls.homepage = "https://github.com/wntrblm/nox" +urls.repository = "https://github.com/wntrblm/nox" +scripts.nox = "nox.__main__:main" +scripts.tox-to-nox = "nox.tox_to_nox:main" [tool.hatch] metadata.allow-ambiguous-features = true # disable normalization (tox-to-nox) for back-compat -[tool.ruff.lint] -extend-select = [ - "B", # flake8-bugbear - "I", # isort - "C4", # flake8-comprehensions - "ICN", # flake8-import-conventions - "ISC", # flake8-implicit-str-concat - "PL", # pylint - "PGH", # pygrep-hooks - "PIE", # flake8-pie - "RUF", # Ruff-specific - "SIM", # flake8-simplify - "UP", # pyupgrade - "YTT", # flake8-2020 - "EXE", # flake8-executable +[tool.ruff] +lint.extend-select = [ + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "EXE", # flake8-executable + "I", # isort + "ICN", # flake8-import-conventions + "ISC", # flake8-implicit-str-concat + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "PL", # pylint + "RUF", # Ruff-specific + "SIM", # flake8-simplify + "UP", # pyupgrade + "YTT", # flake8-2020 ] -ignore = [ +lint.ignore = [ "ISC001", # Conflicts with formatter "PLR09", # Too many X "PLR2004", # Magic value used in comparison @@ -91,6 +88,9 @@ ignore = [ [tool.isort] profile = "black" +[tool.pyproject-fmt] +max_supported_python = "3.13" + [tool.pytest.ini_options] minversion = "6.0" addopts = [ "-ra", "--strict-markers", "--strict-config" ]