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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -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
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.24.2",
"hatchling>=1.25",
]

[project]
Expand Down Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion src/tox_uv/_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 5 additions & 3 deletions tests/test_tox_uv_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =
Expand All @@ -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}
Expand Down
Loading