Skip to content

Commit 9626767

Browse files
committed
Migrate from rye to uv
Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com>
1 parent b03578a commit 9626767

File tree

5 files changed

+512
-70
lines changed

5 files changed

+512
-70
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
66

77
lint:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- name: Install the latest version of rye
12-
uses: eifinger/setup-rye@v4
11+
- name: Install uv
12+
uses: astral-sh/setup-uv@v2
1313
with:
1414
enable-cache: true
15-
- name: Sync dependencies
16-
run: rye sync
15+
cache-dependency-glob: "uv.lock"
16+
- name: Set up Python
17+
run: uv python install
18+
- name: Install the project
19+
run: uv sync --all-extras --dev
1720
- name: Lint
18-
run: rye lint
21+
run: uv run ruff check
1922

2023
test:
2124
strategy:
2225
matrix:
23-
python: ['3.8', '3.9', '3.10', '3.11']
24-
os: [ubuntu-latest, windows-latest, macos-latest]
26+
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
27+
os: [ ubuntu-latest, windows-latest, macos-latest ]
2528
runs-on: ${{ matrix.os }}
2629
steps:
2730
- uses: actions/checkout@v4
28-
- name: Setup Python
29-
uses: actions/setup-python@v5
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v2
3033
with:
31-
python-version: ${{ matrix.python }}
32-
cache: 'pip'
33-
cache-dependency-path: 'requirements/*.txt'
34-
- name: Install dev dependencies
35-
run: python -m pip install -r requirements/dev.txt
36-
- name: Run tests
37-
run: python -m tox -e py # Run tox using the version of Python in `PATH`
34+
enable-cache: true
35+
cache-dependency-glob: "uv.lock"
36+
- name: Set up Python ${{ matrix.python-version }}
37+
run: uv python install ${{ matrix.python-version }}
38+
- name: Install the project
39+
run: uv sync --all-extras --dev
40+
- name: Lint
41+
run: uv run pytest tests

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = [
66
{ name = "The Cloud Events Contributors", email = "cncfcloudevents@gmail.com" }
77
]
88
readme = "README.md"
9-
requires-python = ">= 3.8"
9+
requires-python = ">= 3.9"
1010
license = "Apache-2.0"
1111
classifiers = [
1212
"Intended Audience :: Information Technology",
@@ -31,6 +31,9 @@ keywords = [
3131
"Eventing",
3232
"Serverless",
3333
]
34+
dependencies = [
35+
"ruff>=0.6.8",
36+
]
3437

3538
[project.urls]
3639
"Source code" = "https://github.com/cloudevents/sdk-python"
@@ -41,8 +44,7 @@ keywords = [
4144
requires = ["hatchling"]
4245
build-backend = "hatchling.build"
4346

44-
[tool.rye]
45-
managed = true
47+
[tool.uv]
4648
dev-dependencies = [
4749
"pytest>=8.3.3",
4850
"mypy>=1.11.2",
@@ -53,6 +55,8 @@ dev-dependencies = [
5355
"pre-commit>=3.8.0",
5456
"pytest-cov>=5.0.0",
5557
]
58+
59+
[tool.uv.pip]
5660
universal = true
5761
generate-hashes = true
5862

requirements-dev.lock

Lines changed: 0 additions & 38 deletions
This file was deleted.

requirements.lock

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)