diff --git a/README.md b/README.md index 860811ac..936861d6 100644 --- a/README.md +++ b/README.md @@ -154,8 +154,8 @@ $ uvx usethis ci bitbucket ✔ Writing 'bitbucket-pipelines.yml'. ✔ Adding cache 'uv' definition to 'bitbucket-pipelines.yml'. ✔ Adding 'Run Ruff' to default pipeline in 'bitbucket-pipelines.yml'. -✔ Adding 'Test on 3.12' to default pipeline in 'bitbucket-pipelines.yml'. ✔ Adding 'Test on 3.13' to default pipeline in 'bitbucket-pipelines.yml'. +✔ Adding 'Test on 3.14' to default pipeline in 'bitbucket-pipelines.yml'. ☐ Run your pipeline via the Bitbucket website. ``` diff --git a/docs/example-usage.md b/docs/example-usage.md index 48bbc0f3..4e0276d4 100644 --- a/docs/example-usage.md +++ b/docs/example-usage.md @@ -58,7 +58,7 @@ $ uvx usethis ci bitbucket ✔ Writing 'bitbucket-pipelines.yml'. ✔ Adding cache 'uv' definition to 'bitbucket-pipelines.yml'. ✔ Adding 'Run Ruff' to default pipeline in 'bitbucket-pipelines.yml'. -✔ Adding 'Test on 3.12' to default pipeline in 'bitbucket-pipelines.yml'. ✔ Adding 'Test on 3.13' to default pipeline in 'bitbucket-pipelines.yml'. +✔ Adding 'Test on 3.14' to default pipeline in 'bitbucket-pipelines.yml'. ☐ Run your pipeline via the Bitbucket website. ``` diff --git a/tests/conftest.py b/tests/conftest.py index 113d22fc..f989a410 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,7 +21,7 @@ def _uv_init_dir(tmp_path_factory: pytest.TempPathFactory) -> Path: "--python", # Deliberately kept at at a version other than the latest version to # check range checks e.g. for Bitbucket pipelines matrixes. - "3.12", + "3.13", "--vcs", "none", ], diff --git a/tests/usethis/_core/test_core_ci.py b/tests/usethis/_core/test_core_ci.py index 99ebc303..c7e7d125 100644 --- a/tests/usethis/_core/test_core_ci.py +++ b/tests/usethis/_core/test_core_ci.py @@ -440,8 +440,12 @@ def test_mentioned_in_file( (uv_init_dir / "tests").mkdir() (uv_init_dir / "tests" / "conftest.py").touch() - # Act with change_cwd(uv_init_dir), files_manager(): + PyprojectTOMLManager()[["project"]]["requires-python"] = ( + ">=3.12,<3.14" + ) + + # Act use_ci_bitbucket() # Assert @@ -473,7 +477,7 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path): (uv_init_dir / "pyproject.toml").write_text( """\ [project] -requires-python = ">=3.12,<3.13" +requires-python = ">=3.13,<3.14" """ ) (uv_init_dir / "bitbucket-pipelines.yml").write_text( @@ -482,11 +486,11 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path): pipelines: default: - step: - name: Test on 3.11 + name: Test on 3.12 script: - echo 'Hello, world!' - step: - name: Test on 3.12 + name: Test on 3.13 script: - echo 'Hello, world!' """ @@ -498,7 +502,7 @@ def test_unsupported_python_version_removed(self, uv_init_dir: Path): # Assert contents = (uv_init_dir / "bitbucket-pipelines.yml").read_text() - assert "Test on 3.11" not in contents + assert "Test on 3.12" not in contents class TestRemove: class TestPyproject: diff --git a/tests/usethis/_integrations/sonarqube/test_sonarqube_config.py b/tests/usethis/_integrations/sonarqube/test_sonarqube_config.py index da7d3414..51428813 100644 --- a/tests/usethis/_integrations/sonarqube/test_sonarqube_config.py +++ b/tests/usethis/_integrations/sonarqube/test_sonarqube_config.py @@ -34,7 +34,7 @@ def test_dump_file(self, tmp_path: Path): # Assert assert result == contents - def test_file_not_exists(self, uv_init_dir: Path): + def test_file_doesnt_exist(self, uv_init_dir: Path): # If the file does not exist, we should construct based on information in # the repo. @@ -46,7 +46,7 @@ def test_file_not_exists(self, uv_init_dir: Path): PyprojectTOMLManager().set_value( keys=["tool", "coverage", "xml", "output"], value="coverage.xml" ) - uv_python_pin("3.12") + uv_python_pin("3.13") content = (uv_init_dir / "pyproject.toml").read_text() assert "xml" in content @@ -60,7 +60,7 @@ def test_file_not_exists(self, uv_init_dir: Path): == """\ sonar.projectKey=foobar sonar.language=py -sonar.python.version=3.12 +sonar.python.version=3.13 sonar.sources=./src sonar.tests=./tests sonar.python.coverage.reportPaths=coverage.xml diff --git a/tests/usethis/_tool/impl/test_pytest.py b/tests/usethis/_tool/impl/test_pytest.py index 6bcbe76c..cbb992fb 100644 --- a/tests/usethis/_tool/impl/test_pytest.py +++ b/tests/usethis/_tool/impl/test_pytest.py @@ -16,6 +16,7 @@ class TestUpdateBitbucketSteps: def test_new_file(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]): with change_cwd(uv_init_dir), files_manager(): # Arrange + PyprojectTOMLManager()[["project"]]["requires-python"] = ">=3.12,<3.14" add_placeholder_step_in_default(report_placeholder=False) (uv_init_dir / "pytest.ini").touch() diff --git a/tests/usethis/_ui/interface/test_ci.py b/tests/usethis/_ui/interface/test_ci.py index 6ff26a5c..b1dbe2cb 100644 --- a/tests/usethis/_ui/interface/test_ci.py +++ b/tests/usethis/_ui/interface/test_ci.py @@ -21,7 +21,7 @@ def test_readme_example(self, tmp_path: Path): (tmp_path / "pyproject.toml").write_text( """\ [project] -requires-python = ">=3.12" +requires-python = ">=3.12,<3.14" """ ) diff --git a/tests/usethis/_ui/interface/test_interface_ci.py b/tests/usethis/_ui/interface/test_interface_ci.py index 38a9746c..4d64e97d 100644 --- a/tests/usethis/_ui/interface/test_interface_ci.py +++ b/tests/usethis/_ui/interface/test_interface_ci.py @@ -4,6 +4,7 @@ from typer.testing import CliRunner from usethis._config import usethis_config +from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager from usethis._test import change_cwd from usethis._ui.app import app as main_app from usethis._ui.interface.ci import app @@ -46,6 +47,9 @@ def test_maximal_config(self, uv_init_repo_dir: Path): runner = CliRunner() with change_cwd(uv_init_repo_dir): # Arrange + with PyprojectTOMLManager() as mgr: + mgr[["project"]]["requires-python"] = ">=3.12,<3.14" + for tool_command in ALL_TOOL_COMMANDS: if not usethis_config.offline: result = runner.invoke(main_app, ["tool", tool_command])