Skip to content

Commit e67f3f8

Browse files
committed
Migrate to uv
1 parent f735ee3 commit e67f3f8

16 files changed

Lines changed: 1574 additions & 70 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For the complete development guide, please see **[docs/development.md](../docs/d
1212
## Quick Start
1313

1414
1. Clone the repository
15-
2. Run `make .venv && source .venv/bin/activate && make pip`
15+
2. Run `uv sync --extra dev`
1616
3. Run `make all` to verify everything works
1717

1818
## Before Submitting a Pull Request

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: ISC
44
version: 2
55
updates:
6-
- package-ecosystem: "pip"
6+
- package-ecosystem: "uv"
77
directory: "/"
88
schedule:
99
interval: "weekly"
@@ -17,4 +17,4 @@ updates:
1717
interval: "weekly"
1818
commit-message:
1919
prefix: "ci"
20-
include: "scope"
20+
include: "scope"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# SPDX-License-Identifier: ISC
44

5-
65
name: CI
76

87
on:
@@ -15,7 +14,7 @@ permissions:
1514
contents: read
1615

1716
jobs:
18-
test:
17+
build-test:
1918
runs-on: ubuntu-latest
2019
strategy:
2120
matrix:
@@ -26,6 +25,7 @@ jobs:
2625
- uses: actions/setup-python@v6
2726
with:
2827
python-version: ${{ matrix.python-version }}
29-
- run: make pip
28+
- uses: astral-sh/setup-uv@v7
29+
- run: make sync-frozen
3030
- run: make lint
31-
- run: make coverage
31+
- run: make coverage

.github/workflows/docs.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
contents: write
1616

1717
jobs:
18-
deploy:
18+
docs-deploy:
1919
runs-on: ubuntu-latest
2020
environment:
2121
name: github-pages
@@ -28,24 +28,17 @@ jobs:
2828
- uses: actions/setup-python@v6
2929
with:
3030
python-version: '3.13'
31+
- uses: astral-sh/setup-uv@v7
3132

32-
- name: Install dependencies
33-
run: |
34-
pip install -e .[dev]
33+
- run: make sync-frozen
3534

3635
- name: Configure Git
3736
run: |
3837
git config user.name github-actions[bot]
3938
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
4039
41-
- name: Deploy dev-main docs
42-
if: github.ref == 'refs/heads/main'
43-
run: |
44-
mike deploy --push --branch website dev-main
40+
- if: github.ref == 'refs/heads/main'
41+
run: make docs-deploy-dev-main
4542

46-
- name: Deploy versioned docs
47-
if: startsWith(github.ref, 'refs/tags/v')
48-
run: |
49-
VERSION=${GITHUB_REF#refs/tags/v}
50-
mike deploy --push --update-aliases --branch website $VERSION latest
51-
mike set-default --push --branch website latest
43+
- if: startsWith(github.ref, 'refs/tags/v')
44+
run: make docs-deploy-versioned VERSION=${GITHUB_REF#refs/tags/v}

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ jobs:
2222
- uses: actions/setup-python@v6
2323
with:
2424
python-version: "3.13"
25+
- uses: astral-sh/setup-uv@v7
2526
- run: sudo apt-get install -y patchelf
26-
- run: make pip
27+
- run: make sync-frozen
2728
- run: make publish
2829
env:
2930
TWINE_USERNAME: __token__

Makefile

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,38 @@
22
#
33
# SPDX-License-Identifier: ISC
44

5-
.PHONY: all format lint test coverage clean publish pip reuse .venv docs-serve docs-build
5+
6+
.PHONY: all sync sync-frozen format lint test coverage clean build dist repair-wheels publish reuse docs-serve docs-build docs-deploy-dev-main docs-deploy-versioned
67

78
all: format lint coverage build
89

9-
pip:
10-
python -m pip install --upgrade pip
11-
python -m pip install -e ".[dev]"
10+
sync:
11+
uv sync --extra dev
12+
13+
sync-frozen:
14+
uv sync --frozen --extra dev
1215

1316
reuse:
14-
reuse annotate \
17+
uv run reuse annotate \
1518
--copyright "Alexandre Gomes Gaigalas <alganet@gmail.com>" \
1619
--license ISC \
1720
--recursive .
1821

19-
.venv:
20-
python -m venv .venv
21-
. .venv/bin/activate && make pip
22-
2322
format: reuse
24-
python -m black apywire tests
25-
python -m isort apywire tests
23+
uv run black apywire tests
24+
uv run isort apywire tests
2625

2726
lint:
28-
python -m reuse lint
29-
python -m flake8 apywire tests
30-
python -m mypy apywire tests
27+
uv run reuse lint
28+
uv run flake8 apywire tests
29+
uv run mypy apywire tests
3130

3231
test:
33-
python -m pytest -q
32+
uv run pytest -q
3433

3534
coverage:
3635
rm -f apywire/*.so apywire/wiring.c
37-
python -m pytest --cov
36+
uv run pytest --cov
3837

3938
clean:
4039
find . -name __pycache__ -type d -exec rm -rf {} +
@@ -43,24 +42,33 @@ clean:
4342
rm -rf .mypy_cache .pytest_cache *.egg-info dist build
4443

4544
build:
46-
python setup.py build_ext --inplace
45+
uv run python setup.py build_ext --inplace
4746

4847
dist:
49-
python -m build
48+
uv run python -m build
5049

5150
repair-wheels:
52-
python -m pip install --upgrade auditwheel
53-
auditwheel repair dist/*.whl -w dist/repaired
51+
uv run auditwheel repair dist/*.whl -w dist/repaired
5452
rm -f dist/*.whl
5553
mv dist/repaired/*.whl dist/
5654
rm -rf dist/repaired
5755

5856
publish: dist repair-wheels
59-
python -m pip install --upgrade twine
60-
python -m twine upload dist/*
57+
uv run twine upload dist/*
6158

6259
docs-serve:
63-
python -m mkdocs serve
60+
uv run mkdocs serve
6461

6562
docs-build:
66-
python -m mkdocs build
63+
uv run mkdocs build
64+
65+
docs-deploy-dev-main:
66+
uv run mike deploy --push --branch website dev-main
67+
68+
docs-deploy-versioned:
69+
@if [ -z "$(VERSION)" ]; then \
70+
echo "VERSION is required (e.g. make $@ VERSION=0.2.0)"; \
71+
exit 2; \
72+
fi
73+
uv run mike deploy --push --update-aliases --branch website $(VERSION) latest
74+
uv run mike set-default --push --branch website latest

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Lazy object wiring and dependency injection for Python 3.12+
2626
## Installation
2727

2828
```bash
29-
pip install apywire
29+
uv pip install apywire
3030
```
3131

3232
## Quick Example
@@ -58,8 +58,8 @@ make docs-serve # http://127.0.0.1:8000
5858
## Development
5959

6060
```bash
61-
make .venv && source .venv/bin/activate # Setup
62-
make all # Format, lint, test, build
61+
uv sync --extra dev # Setup
62+
make all # Format, lint, test, build
6363
```
6464

6565
See [docs/development.md](docs/development.md) for guidelines.

REUSE.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ precedence = "aggregate"
1010
SPDX-FileCopyrightText = "2025 Alexandre Gomes Gaigalas <alganet@gmail.com>"
1111
SPDX-License-Identifier = "ISC"
1212

13+
[[annotations]]
14+
path = "uv.lock"
15+
precedence = "aggregate"
16+
SPDX-FileCopyrightText = "2025 Alexandre Gomes Gaigalas <alganet@gmail.com>"
17+
SPDX-License-Identifier = "ISC"
18+

docs/development.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ Clone the repository and set up your development environment:
2424
git clone https://github.com/alganet/apywire.git
2525
cd apywire
2626

27-
# Create virtual environment and install dependencies
28-
make .venv
29-
source .venv/bin/activate
30-
make pip
27+
# Install dev dependencies
28+
uv sync --extra dev
3129
```
3230

3331
This will:
34-
1. Create a `.venv` virtual environment
32+
1. Create (or update) a `.venv` project environment
3533
2. Install all development dependencies including mkdocs, pytest, mypy, etc.
3634

3735
## Development Workflow

docs/getting-started.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This guide will help you get up and running with apywire quickly.
1010

1111
## Installation
1212

13-
Install apywire using pip:
13+
Install apywire using uv:
1414

1515
```bash
16-
pip install apywire
16+
uv pip install apywire
1717
```
1818

1919
apywire requires Python 3.12 or later and has no external runtime dependencies.
@@ -25,9 +25,7 @@ If you want to contribute to apywire or run the tests:
2525
```bash
2626
git clone https://github.com/alganet/apywire.git
2727
cd apywire
28-
make .venv
29-
source .venv/bin/activate
30-
make pip
28+
uv sync --extra dev
3129
```
3230

3331
## Quick Start

0 commit comments

Comments
 (0)