Skip to content

Commit d11deea

Browse files
committed
build: migrate to uv
1 parent 8b6003d commit d11deea

4 files changed

Lines changed: 1116 additions & 22 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434

35+
- uses: astral-sh/setup-uv@v6
36+
3537
- name: Install
3638
run: make install-dev
3739

@@ -55,6 +57,8 @@ jobs:
5557
with:
5658
python-version: ${{ matrix.python-version }}
5759

60+
- uses: astral-sh/setup-uv@v6
61+
5862
- name: Install
5963
run: make install-dev
6064

@@ -109,11 +113,10 @@ jobs:
109113
with:
110114
python-version: '3.10'
111115

112-
- name: Install dependencies
113-
run: pip install -U setuptools wheel build
116+
- uses: astral-sh/setup-uv@v6
114117

115118
- name: Build the package
116-
run: python -m build
119+
run: uv build
117120

118121
- name: Publish to PyPI
119122
uses: pypa/gh-action-pypi-publish@v1.4.2

Makefile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
srcs = src docs/modules/ROOT/examples tests
2+
UV_SYNC = uv sync --extra dev
3+
UV_RUN = uv run --extra dev
24

35
## all: Run linter and tests.
46
.PHONY: all
@@ -11,18 +13,18 @@ help: Makefile
1113

1214
## install: Install all requirements.
1315
.PHONY: install
14-
install: install-corva-sdk install-dev
16+
install:
17+
@$(UV_SYNC)
1518

1619
## install-corva-sdk: Install corva-sdk requirements.
1720
.PHONY: install-corva-sdk
1821
install-corva-sdk:
19-
@pip install -U pip
20-
@pip install -U -e .
22+
@uv sync
2123

2224
## install-dev: Install dev requirements.
2325
.PHONY: install-dev
24-
install-dev: install-corva-sdk
25-
@pip install -U '.[dev]'
26+
install-dev:
27+
@$(UV_SYNC)
2628

2729

2830
## test: Run tests.
@@ -32,39 +34,39 @@ test: up-cache unit-tests integration-tests down-cache
3234
## unit-tests: Run unit tests.
3335
unit-tests: test_path = tests/unit
3436
unit-tests:
35-
@coverage run -m pytest $(test_path)
37+
@$(UV_RUN) coverage run -m pytest $(test_path)
3638

3739
## integration-tests: Run integration tests.
3840
.PHONY: integration-tests
3941
integration-tests: export CACHE_URL = redis://localhost:6379
4042
integration-tests: test_path = tests/integration
4143
integration-tests:
42-
@coverage run -m pytest $(test_path)
44+
@$(UV_RUN) coverage run -m pytest $(test_path)
4345

4446
## coverage: Display code coverage in the console.
4547
.PHONY: coverage
4648
coverage: test
47-
@coverage combine
48-
@coverage report --sort=cover
49+
@$(UV_RUN) coverage combine
50+
@$(UV_RUN) coverage report --sort=cover
4951

5052
## coverage-html: Display code coverage in the browser.
5153
.PHONY: coverage-html
5254
coverage-html: test
53-
@coverage combine
54-
@coverage html
55+
@$(UV_RUN) coverage combine
56+
@$(UV_RUN) coverage html
5557
@x-www-browser htmlcov/index.html
5658

5759
## lint: Run linter.
5860
.PHONY: lint
5961
lint:
60-
@ruff check $(srcs)
61-
@mypy $(srcs)
62+
@$(UV_RUN) ruff check $(srcs)
63+
@$(UV_RUN) mypy $(srcs)
6264

6365
## format: Format all files.
6466
.PHONY: format
6567
format:
66-
@ruff check --fix $(srcs)
67-
@ruff format $(srcs)
68+
@$(UV_RUN) ruff check --fix $(srcs)
69+
@$(UV_RUN) ruff format $(srcs)
6870

6971
## docs: Generate docs.
7072
.PHONY: docs

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "corva-sdk"
77
description = "SDK for building Corva DevCenter Python apps."
88
readme = "README.md"
99
version = "2.1.1"
10-
license = { text = "The Unlicense" }
10+
license = "Unlicense"
1111
authors = [
1212
{ name = "Jordan Ambra", email = "jordan.ambra@corva.ai" }
1313
]
@@ -45,9 +45,9 @@ dev = [
4545
"types-requests~=2.27.27",
4646
"coverage==7.6.1",
4747
"freezegun==1.5.1",
48-
"pytest==6.2.5",
49-
"pytest-mock==3.3.1",
50-
"requests-mock==1.8.0",
48+
"pytest~=8.3.5",
49+
"pytest-mock~=3.14.0",
50+
"requests-mock~=1.12.1",
5151
]
5252

5353
[tool.setuptools]

0 commit comments

Comments
 (0)