Skip to content

Commit 18c1677

Browse files
authored
Fix CI for new UV (#74)
1 parent 1f398a0 commit 18c1677

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.29.0
8+
rev: 0.29.1
99
hooks:
1010
- id: check-github-workflows
1111
args: [ "--verbose" ]
@@ -20,11 +20,11 @@ repos:
2020
- id: tox-ini-fmt
2121
args: ["-p", "fix"]
2222
- repo: https://github.com/tox-dev/pyproject-fmt
23-
rev: "2.1.4"
23+
rev: "2.2.1"
2424
hooks:
2525
- id: pyproject-fmt
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.5.4"
27+
rev: "v0.5.5"
2828
hooks:
2929
- id: ruff-format
3030
- id: ruff

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.4",
5-
"hatchling>=1.24.2",
5+
"hatchling>=1.25",
66
]
77

88
[project]
@@ -41,15 +41,15 @@ dynamic = [
4141
]
4242
dependencies = [
4343
"importlib-resources>=6.4; python_version<'3.9'",
44-
"packaging>=24",
45-
"tox<5,>=4.15",
44+
"packaging>=24.1",
45+
"tox<5,>=4.16",
4646
"typing-extensions>=4.12.2; python_version<'3.10'",
47-
"uv<1,>=0.2.5",
47+
"uv<1,>=0.2.33",
4848
]
4949
optional-dependencies.test = [
5050
"covdefaults>=2.3",
5151
"devpi-process>=1",
52-
"pytest>=8.2.1",
52+
"pytest>=8.3.2",
5353
"pytest-cov>=5",
5454
"pytest-mock>=3.14",
5555
]
@@ -97,9 +97,10 @@ lint.per-file-ignores."tests/**/*.py" = [
9797
"D", # don"t care about documentation in tests
9898
"FBT", # don"t care about booleans as positional arguments in tests
9999
"INP001", # no implicit namespace
100+
"PLC2701", # private import is fine
100101
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
102+
"S", # no safety concerns
101103
"S101", # asserts allowed in tests...
102-
"S603", # `subprocess` call: check for execution of untrusted input
103104
]
104105
lint.isort = { known-first-party = [
105106
"tox_uv",

src/tox_uv/_venv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141
from tox.tox_env.installer import Installer
4242

4343

44-
PythonPreference: TypeAlias = Literal["only-managed", "installed", "managed", "system", "only-system"]
44+
PythonPreference: TypeAlias = Literal[
45+
"only-managed",
46+
"managed",
47+
"system",
48+
"only-system",
49+
]
4550

4651

4752
class UvVenv(Python, ABC):

tests/test_tox_uv_venv.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import os.path
66
import pathlib
77
import platform
8-
import subprocess # noqa: S404
8+
import subprocess
99
import sys
1010
from configparser import ConfigParser
1111
from importlib.metadata import version
12-
from typing import TYPE_CHECKING
12+
from typing import TYPE_CHECKING, get_args
1313

1414
import pytest
1515

16+
from tox_uv._venv import PythonPreference
17+
1618
if TYPE_CHECKING:
1719
from tox.pytest import ToxProjectCreator
1820

@@ -178,7 +180,7 @@ def test_uv_env_python(tox_project: ToxProjectCreator) -> None:
178180

179181
@pytest.mark.parametrize(
180182
"preference",
181-
["only-managed", "installed", "managed", "system", "only-system"],
183+
get_args(PythonPreference),
182184
)
183185
def test_uv_env_python_preference(
184186
tox_project: ToxProjectCreator,

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import sys
4-
from subprocess import check_output # noqa: S404
4+
from subprocess import check_output
55

66

77
def test_version() -> None:

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ commands =
2525
--cov {envsitepackagesdir}{/}tox_uv --cov {toxinidir}{/}tests --cov-context=test \
2626
--no-cov-on-fail --cov-config {toxinidir}{/}pyproject.toml \
2727
--cov-report term-missing:skip-covered --junitxml {toxworkdir}{/}junit.{envname}.xml \
28-
--cov-report html:{envtmpdir}{/}htmlcov \
28+
--cov-report html:{envtmpdir}{/}htmlcov --durations=5 \
2929
tests}
3030

3131
[testenv:fix]
3232
description = run static analysis and style check using flake8
3333
skip_install = true
3434
deps =
35-
pre-commit>=3.7.1
35+
pre-commit>=3.8
3636
pass_env =
3737
HOMEPATH
3838
PROGRAMDATA
@@ -42,7 +42,7 @@ commands =
4242
[testenv:type]
4343
description = run type check on code base
4444
deps =
45-
mypy==1.10
45+
mypy==1.11.1
4646
set_env =
4747
{tty:MYPY_FORCE_COLOR = 1}
4848
commands =
@@ -54,7 +54,7 @@ description = check that the package metadata is correct
5454
skip_install = true
5555
deps =
5656
build[virtualenv]>=1.2.1
57-
twine>=5.1
57+
twine>=5.1.1
5858
set_env =
5959
{tty:FORCE_COLOR = 1}
6060
change_dir = {toxinidir}

0 commit comments

Comments
 (0)