Skip to content

Commit 02c2a50

Browse files
Support uv v0.8.0 (#867)
* Use `--no-managed-python` in `Setup dependencies` step of CI * Bump the uv lower bound to make `--no-managed-python` available * Bump dev version of Python to 3.10.18 * Bump uv lower bound in README * Pin the Python version explicitly in CI * In tests which sentinel for version bumps, use `requires-python` rather than `.python-version` This is since the latter can now change dynamically in CI. We need something for determining usethis's minimum supported Python verion.
1 parent d6e9ad6 commit 02c2a50

6 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545

4646
- name: Setup dependencies
4747
run: |
48-
uv export --resolution ${{ matrix.resolution }} > ci-requirements.txt
48+
uv python pin ${{ matrix.python-version }}
49+
uv export --no-managed-python --resolution ${{ matrix.resolution }} > ci-requirements.txt
4950
uv pip install --system -r ci-requirements.txt
5051
5152
- name: Run pre-commit
@@ -92,7 +93,7 @@ jobs:
9293
include:
9394
- os: "ubuntu-latest"
9495
python-version: "3.10"
95-
uv-version: "0.5.29" # Sync with pyproject.toml
96+
uv-version: "0.6.8" # Sync with pyproject.toml
9697
resolution: "lowest-direct"
9798
codspeed: false
9899
codecov: false

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.14
1+
3.10.18

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Inspired by an [**R** package of the same name](https://usethis.r-lib.org/index.
4040
## 🧭 Getting Started
4141

4242
First, it is strongly recommended you [install the uv package manager](https://docs.astral.sh/uv/getting-started/installation/): this is a simple, documented process. If you're already using uv, make sure you're using at least
43-
version v0.5.29 (run `uv version` to check, and `uv self update` to upgrade).
43+
version v0.6.8 (run `uv version` to check, and `uv self update` to upgrade).
4444

4545
> [!TIP]
4646
> At the moment, usethis assumes you will have uv installed in some circumstances. Support for projects that don't use uv is planned for late 2025.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ exclude_also = [
170170
omit = [ "*/pytest-of-*/*" ]
171171

172172
[tool.uv]
173-
required-version = ">=0.5.29" # Sync with README
173+
required-version = ">=0.6.8" # Sync with README
174174
default-groups = [ "test", "dev", "doc" ]
175175
link-mode = "symlink"
176176

tests/usethis/_integrations/ci/bitbucket/test_bitbucket_schema.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import requests
66

77
from usethis._integrations.ci.bitbucket.schema import Script, Step, Step2, StepBase
8+
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
9+
from usethis._integrations.file.pyproject_toml.requires_python import (
10+
get_requires_python,
11+
)
812
from usethis._test import is_offline
913

1014

@@ -40,4 +44,5 @@ def test_matches_schema_store(self):
4044

4145
def test_target_python_version(self):
4246
# If this test fails, we should bump the version in the command in schema.py
43-
assert Path(".python-version").read_text().startswith("3.10")
47+
with PyprojectTOMLManager():
48+
assert get_requires_python() == ">=3.10"

tests/usethis/_integrations/pre_commit/test_pre_commit_schema.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import pytest
55
import requests
66

7+
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
8+
from usethis._integrations.file.pyproject_toml.requires_python import (
9+
get_requires_python,
10+
)
711
from usethis._integrations.pre_commit.schema import HookDefinition, LocalRepo
812
from usethis._test import is_offline
913

@@ -42,4 +46,5 @@ def test_matches_schema_store(self):
4246

4347
def test_target_python_version(self):
4448
# If this test fails, we should bump the version in the command in schema.py
45-
assert Path(".python-version").read_text().startswith("3.10")
49+
with PyprojectTOMLManager():
50+
assert get_requires_python() == ">=3.10"

0 commit comments

Comments
 (0)