diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d81dce2..f5ee6de 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/python-jsonschema/check-jsonschema - rev: 0.29.0 + rev: 0.29.1 hooks: - id: check-github-workflows args: [ "--verbose" ] @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.1.4" + rev: "2.2.1" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.4" + rev: "v0.5.5" hooks: - id: ruff-format - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 84e7c0e..3fc4765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.4", - "hatchling>=1.24.2", + "hatchling>=1.25", ] [project] @@ -41,15 +41,15 @@ dynamic = [ ] dependencies = [ "importlib-resources>=6.4; python_version<'3.9'", - "packaging>=24", - "tox<5,>=4.15", + "packaging>=24.1", + "tox<5,>=4.16", "typing-extensions>=4.12.2; python_version<'3.10'", - "uv<1,>=0.2.5", + "uv<1,>=0.2.33", ] optional-dependencies.test = [ "covdefaults>=2.3", "devpi-process>=1", - "pytest>=8.2.1", + "pytest>=8.3.2", "pytest-cov>=5", "pytest-mock>=3.14", ] @@ -97,9 +97,10 @@ lint.per-file-ignores."tests/**/*.py" = [ "D", # don"t care about documentation in tests "FBT", # don"t care about booleans as positional arguments in tests "INP001", # no implicit namespace + "PLC2701", # private import is fine "PLR2004", # Magic value used in comparison, consider replacing with a constant variable + "S", # no safety concerns "S101", # asserts allowed in tests... - "S603", # `subprocess` call: check for execution of untrusted input ] lint.isort = { known-first-party = [ "tox_uv", diff --git a/src/tox_uv/_venv.py b/src/tox_uv/_venv.py index 2b36d76..19db41c 100644 --- a/src/tox_uv/_venv.py +++ b/src/tox_uv/_venv.py @@ -41,7 +41,12 @@ from tox.tox_env.installer import Installer -PythonPreference: TypeAlias = Literal["only-managed", "installed", "managed", "system", "only-system"] +PythonPreference: TypeAlias = Literal[ + "only-managed", + "managed", + "system", + "only-system", +] class UvVenv(Python, ABC): diff --git a/tests/test_tox_uv_venv.py b/tests/test_tox_uv_venv.py index b8a9332..8bc56c5 100644 --- a/tests/test_tox_uv_venv.py +++ b/tests/test_tox_uv_venv.py @@ -5,14 +5,16 @@ import os.path import pathlib import platform -import subprocess # noqa: S404 +import subprocess import sys from configparser import ConfigParser from importlib.metadata import version -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, get_args import pytest +from tox_uv._venv import PythonPreference + if TYPE_CHECKING: from tox.pytest import ToxProjectCreator @@ -178,7 +180,7 @@ def test_uv_env_python(tox_project: ToxProjectCreator) -> None: @pytest.mark.parametrize( "preference", - ["only-managed", "installed", "managed", "system", "only-system"], + get_args(PythonPreference), ) def test_uv_env_python_preference( tox_project: ToxProjectCreator, diff --git a/tests/test_version.py b/tests/test_version.py index ad428bd..1134e5a 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,7 +1,7 @@ from __future__ import annotations import sys -from subprocess import check_output # noqa: S404 +from subprocess import check_output def test_version() -> None: diff --git a/tox.ini b/tox.ini index 07b5141..3f6d86d 100644 --- a/tox.ini +++ b/tox.ini @@ -25,14 +25,14 @@ commands = --cov {envsitepackagesdir}{/}tox_uv --cov {toxinidir}{/}tests --cov-context=test \ --no-cov-on-fail --cov-config {toxinidir}{/}pyproject.toml \ --cov-report term-missing:skip-covered --junitxml {toxworkdir}{/}junit.{envname}.xml \ - --cov-report html:{envtmpdir}{/}htmlcov \ + --cov-report html:{envtmpdir}{/}htmlcov --durations=5 \ tests} [testenv:fix] description = run static analysis and style check using flake8 skip_install = true deps = - pre-commit>=3.7.1 + pre-commit>=3.8 pass_env = HOMEPATH PROGRAMDATA @@ -42,7 +42,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.10 + mypy==1.11.1 set_env = {tty:MYPY_FORCE_COLOR = 1} commands = @@ -54,7 +54,7 @@ description = check that the package metadata is correct skip_install = true deps = build[virtualenv]>=1.2.1 - twine>=5.1 + twine>=5.1.1 set_env = {tty:FORCE_COLOR = 1} change_dir = {toxinidir}