Skip to content

Commit cec1c80

Browse files
Pass CI on uv 0.9.0 (Python 3.14) (#961)
* Support Python 3.14 * Move to using pinned version bounds in tests instead of bumping * Bump Python version in SonarQube test
1 parent f879fbf commit cec1c80

8 files changed

Lines changed: 21 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ $ uvx usethis ci bitbucket
154154
✔ Writing 'bitbucket-pipelines.yml'.
155155
✔ Adding cache 'uv' definition to 'bitbucket-pipelines.yml'.
156156
✔ Adding 'Run Ruff' to default pipeline in 'bitbucket-pipelines.yml'.
157-
✔ Adding 'Test on 3.12' to default pipeline in 'bitbucket-pipelines.yml'.
158157
✔ Adding 'Test on 3.13' to default pipeline in 'bitbucket-pipelines.yml'.
158+
✔ Adding 'Test on 3.14' to default pipeline in 'bitbucket-pipelines.yml'.
159159
☐ Run your pipeline via the Bitbucket website.
160160
```
161161

docs/example-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ $ uvx usethis ci bitbucket
5858
✔ Writing 'bitbucket-pipelines.yml'.
5959
✔ Adding cache 'uv' definition to 'bitbucket-pipelines.yml'.
6060
✔ Adding 'Run Ruff' to default pipeline in 'bitbucket-pipelines.yml'.
61-
✔ Adding 'Test on 3.12' to default pipeline in 'bitbucket-pipelines.yml'.
6261
✔ Adding 'Test on 3.13' to default pipeline in 'bitbucket-pipelines.yml'.
62+
✔ Adding 'Test on 3.14' to default pipeline in 'bitbucket-pipelines.yml'.
6363
☐ Run your pipeline via the Bitbucket website.
6464
```

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _uv_init_dir(tmp_path_factory: pytest.TempPathFactory) -> Path:
2121
"--python",
2222
# Deliberately kept at at a version other than the latest version to
2323
# check range checks e.g. for Bitbucket pipelines matrixes.
24-
"3.12",
24+
"3.13",
2525
"--vcs",
2626
"none",
2727
],

tests/usethis/_core/test_core_ci.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,12 @@ def test_mentioned_in_file(
440440
(uv_init_dir / "tests").mkdir()
441441
(uv_init_dir / "tests" / "conftest.py").touch()
442442

443-
# Act
444443
with change_cwd(uv_init_dir), files_manager():
444+
PyprojectTOMLManager()[["project"]]["requires-python"] = (
445+
">=3.12,<3.14"
446+
)
447+
448+
# Act
445449
use_ci_bitbucket()
446450

447451
# Assert
@@ -473,7 +477,7 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path):
473477
(uv_init_dir / "pyproject.toml").write_text(
474478
"""\
475479
[project]
476-
requires-python = ">=3.12,<3.13"
480+
requires-python = ">=3.13,<3.14"
477481
"""
478482
)
479483
(uv_init_dir / "bitbucket-pipelines.yml").write_text(
@@ -482,11 +486,11 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path):
482486
pipelines:
483487
default:
484488
- step:
485-
name: Test on 3.11
489+
name: Test on 3.12
486490
script:
487491
- echo 'Hello, world!'
488492
- step:
489-
name: Test on 3.12
493+
name: Test on 3.13
490494
script:
491495
- echo 'Hello, world!'
492496
"""
@@ -498,7 +502,7 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path):
498502

499503
# Assert
500504
contents = (uv_init_dir / "bitbucket-pipelines.yml").read_text()
501-
assert "Test on 3.11" not in contents
505+
assert "Test on 3.12" not in contents
502506

503507
class TestRemove:
504508
class TestPyproject:

tests/usethis/_integrations/sonarqube/test_sonarqube_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_dump_file(self, tmp_path: Path):
3434
# Assert
3535
assert result == contents
3636

37-
def test_file_not_exists(self, uv_init_dir: Path):
37+
def test_file_doesnt_exist(self, uv_init_dir: Path):
3838
# If the file does not exist, we should construct based on information in
3939
# the repo.
4040

@@ -46,7 +46,7 @@ def test_file_not_exists(self, uv_init_dir: Path):
4646
PyprojectTOMLManager().set_value(
4747
keys=["tool", "coverage", "xml", "output"], value="coverage.xml"
4848
)
49-
uv_python_pin("3.12")
49+
uv_python_pin("3.13")
5050
content = (uv_init_dir / "pyproject.toml").read_text()
5151
assert "xml" in content
5252

@@ -60,7 +60,7 @@ def test_file_not_exists(self, uv_init_dir: Path):
6060
== """\
6161
sonar.projectKey=foobar
6262
sonar.language=py
63-
sonar.python.version=3.12
63+
sonar.python.version=3.13
6464
sonar.sources=./src
6565
sonar.tests=./tests
6666
sonar.python.coverage.reportPaths=coverage.xml

tests/usethis/_tool/impl/test_pytest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class TestUpdateBitbucketSteps:
1616
def test_new_file(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
1717
with change_cwd(uv_init_dir), files_manager():
1818
# Arrange
19+
PyprojectTOMLManager()[["project"]]["requires-python"] = ">=3.12,<3.14"
1920
add_placeholder_step_in_default(report_placeholder=False)
2021
(uv_init_dir / "pytest.ini").touch()
2122

tests/usethis/_ui/interface/test_ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_readme_example(self, tmp_path: Path):
2121
(tmp_path / "pyproject.toml").write_text(
2222
"""\
2323
[project]
24-
requires-python = ">=3.12"
24+
requires-python = ">=3.12,<3.14"
2525
"""
2626
)
2727

tests/usethis/_ui/interface/test_interface_ci.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typer.testing import CliRunner
55

66
from usethis._config import usethis_config
7+
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
78
from usethis._test import change_cwd
89
from usethis._ui.app import app as main_app
910
from usethis._ui.interface.ci import app
@@ -46,6 +47,9 @@ def test_maximal_config(self, uv_init_repo_dir: Path):
4647
runner = CliRunner()
4748
with change_cwd(uv_init_repo_dir):
4849
# Arrange
50+
with PyprojectTOMLManager() as mgr:
51+
mgr[["project"]]["requires-python"] = ">=3.12,<3.14"
52+
4953
for tool_command in ALL_TOOL_COMMANDS:
5054
if not usethis_config.offline:
5155
result = runner.invoke(main_app, ["tool", tool_command])

0 commit comments

Comments
 (0)