Skip to content

Commit 1913b40

Browse files
authored
Merge branch 'main' into python3.14
2 parents 82b1639 + 8335503 commit 1913b40

File tree

10 files changed

+31
-56
lines changed

10 files changed

+31
-56
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v5
25-
- uses: astral-sh/setup-uv@v6
25+
- uses: astral-sh/setup-uv@v7
2626
with:
2727
enable-cache: true
2828
- name: Install just
@@ -43,7 +43,7 @@ jobs:
4343

4444
steps:
4545
- uses: actions/checkout@v5
46-
- uses: astral-sh/setup-uv@v6
46+
- uses: astral-sh/setup-uv@v7
4747
with:
4848
enable-cache: true
4949
python-version: ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: python-no-log-warn
2626
- id: text-unicode-replacement-char
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.13.3
28+
rev: v0.14.0
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff-check

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1414
- {pull}`708` updates mypy and fixes type issues.
1515
- {pull}`709` adds uv pre-commit check.
1616
- {pull}`710` adds support for Python 3.14.
17+
- {pull}`713` removes uv as a test dependency. Closes {issue}`712`. Thanks to {user}`erooke`!
1718

1819
## 0.5.5 - 2025-07-25
1920

tests/test_capture.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def task_show_capture():
8787
"""
8888
tmp_path.joinpath("workflow.py").write_text(textwrap.dedent(source))
8989

90-
result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
90+
result = run_in_subprocess((sys.executable, "workflow.py"), cwd=tmp_path)
9191

9292
assert result.exit_code == ExitCode.FAILED
9393

@@ -128,7 +128,7 @@ def test_wrong_capture_method(tmp_path):
128128
"""
129129
tmp_path.joinpath("workflow.py").write_text(textwrap.dedent(source))
130130

131-
result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
131+
result = run_in_subprocess((sys.executable, "workflow.py"), cwd=tmp_path)
132132
assert result.exit_code == ExitCode.CONFIGURATION_FAILED
133133
assert "Value 'a' is not a valid" in result.stdout
134134
assert "Traceback" not in result.stdout
@@ -255,7 +255,7 @@ def task_unicode():
255255
tmp_path.joinpath("workflow.py").write_text(
256256
textwrap.dedent(source), encoding="utf-8"
257257
)
258-
result = run_in_subprocess(("uv", "run", "python", "workflow.py"), cwd=tmp_path)
258+
result = run_in_subprocess((sys.executable, "workflow.py"), cwd=tmp_path)
259259
assert result.exit_code == ExitCode.OK
260260
assert "1 Succeeded" in result.stdout
261261

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_paths_are_relative_to_configuration_file(tmp_path):
114114
session = build(paths=[Path("src")])
115115
"""
116116
tmp_path.joinpath("script.py").write_text(textwrap.dedent(source))
117-
result = run_in_subprocess(("uv", "run", "python", "script.py"), cwd=tmp_path)
117+
result = run_in_subprocess((sys.executable, "script.py"), cwd=tmp_path)
118118
assert result.exit_code == ExitCode.OK
119119
assert "1 Succeeded" in result.stdout
120120

tests/test_dag_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def main():
9292
tmp_path.joinpath("input.txt").touch()
9393

9494
result = subprocess.run(
95-
("uv", "run", "python", "task_example.py"),
95+
(sys.executable, "task_example.py"),
9696
cwd=tmp_path,
9797
check=True,
9898
capture_output=True,

tests/test_execute.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525

2626
def test_python_m_pytask(tmp_path):
2727
tmp_path.joinpath("task_module.py").write_text("def task_example(): pass")
28-
result = run_in_subprocess(
29-
("uv", "run", "python", "-m", "pytask", tmp_path.as_posix())
30-
)
28+
result = run_in_subprocess((sys.executable, "-m", "pytask", tmp_path.as_posix()))
3129
assert result.exit_code == ExitCode.OK
3230

3331

@@ -602,7 +600,7 @@ def create_file(
602600
"""
603601
tmp_path.joinpath("task_module.py").write_text(textwrap.dedent(source))
604602
result = subprocess.run(
605-
("uv", "run", "python", tmp_path.joinpath("task_module.py").as_posix()),
603+
(sys.executable, tmp_path.joinpath("task_module.py").as_posix()),
606604
check=False,
607605
)
608606
assert result.returncode == ExitCode.OK
@@ -632,7 +630,7 @@ def task2() -> None: pass
632630
"""
633631
tmp_path.joinpath("task_module.py").write_text(textwrap.dedent(source))
634632
result = run_in_subprocess(
635-
("uv", "run", "python", tmp_path.joinpath("task_module.py").as_posix())
633+
(sys.executable, tmp_path.joinpath("task_module.py").as_posix())
636634
)
637635
assert result.exit_code == ExitCode.OK
638636

tests/test_hook_module.py

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import subprocess
4+
import sys
45
import textwrap
56

67
import pytest
@@ -9,8 +10,8 @@
910
from tests.conftest import run_in_subprocess
1011

1112

12-
@pytest.mark.parametrize("module_name", [True, False])
13-
def test_add_new_hook_via_cli(tmp_path, module_name):
13+
@pytest.mark.parametrize("hook_location", ["hooks/hooks.py", "hooks.hooks"])
14+
def test_add_new_hook_via_cli(tmp_path, hook_location):
1415
hooks = """
1516
import click
1617
from pytask import hookimpl
@@ -23,38 +24,24 @@ def pytask_extend_command_line_interface(cli):
2324
tmp_path.joinpath("hooks").mkdir()
2425
tmp_path.joinpath("hooks", "hooks.py").write_text(textwrap.dedent(hooks))
2526

26-
if module_name:
27-
args = (
28-
"uv",
29-
"run",
30-
"python",
31-
"-m",
32-
"pytask",
33-
"build",
34-
"--hook-module",
35-
"hooks.hooks",
36-
"--help",
37-
)
38-
else:
39-
args = (
40-
"uv",
41-
"run",
42-
"pytask",
43-
"build",
44-
"--hook-module",
45-
"hooks/hooks.py",
46-
"--help",
47-
)
48-
27+
args = (
28+
sys.executable,
29+
"-m",
30+
"pytask",
31+
"build",
32+
"--hook-module",
33+
hook_location,
34+
"--help",
35+
)
4936
result = run_in_subprocess(args, cwd=tmp_path)
5037
assert result.exit_code == ExitCode.OK
5138
assert "--new-option" in result.stdout
5239

5340

54-
@pytest.mark.parametrize("module_name", [True, False])
55-
def test_add_new_hook_via_config(tmp_path, module_name):
41+
@pytest.mark.parametrize("hook_location", ["hooks/hooks.py", "hooks.hooks"])
42+
def test_add_new_hook_via_config(tmp_path, hook_location):
5643
tmp_path.joinpath("pyproject.toml").write_text(
57-
"[tool.pytask.ini_options]\nhook_module = ['hooks/hooks.py']"
44+
f"[tool.pytask.ini_options]\nhook_module = ['{hook_location}']"
5845
)
5946

6047
hooks = """
@@ -68,19 +55,7 @@ def pytask_extend_command_line_interface(cli):
6855
tmp_path.joinpath("hooks").mkdir()
6956
tmp_path.joinpath("hooks", "hooks.py").write_text(textwrap.dedent(hooks))
7057

71-
if module_name:
72-
args = (
73-
"uv",
74-
"run",
75-
"--no-project",
76-
"python",
77-
"-m",
78-
"pytask",
79-
"build",
80-
"--help",
81-
)
82-
else:
83-
args = ("uv", "run", "--no-project", "pytask", "build", "--help")
58+
args = (sys.executable, "-m", "pytask", "build", "--help")
8459

8560
result = run_in_subprocess(args, cwd=tmp_path)
8661
assert result.exit_code == ExitCode.OK

tests/test_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def task_second():
667667
tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(source))
668668

669669
result = subprocess.run(
670-
("uv", "run", "python", "task_example.py"),
670+
(sys.executable, "task_example.py"),
671671
cwd=tmp_path,
672672
capture_output=True,
673673
check=False,

tests/test_warnings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import sys
34
import textwrap
45

56
import pytest
@@ -148,7 +149,7 @@ def warn_now():
148149
path_to_warn_module.write_text(textwrap.dedent(warn_module))
149150

150151
# Cannot use runner since then warnings are not ignored by default.
151-
result = run_in_subprocess(("uv", "run", "pytask"), cwd=tmp_path)
152+
result = run_in_subprocess((sys.executable, "-m", "pytask"), cwd=tmp_path)
152153
assert result.exit_code == ExitCode.OK
153154
assert "Warnings" not in result.stdout
154155
assert "warning!!!" not in result.stdout

0 commit comments

Comments
 (0)