Skip to content

Commit c14dad8

Browse files
committed
use uv
1 parent a8df010 commit c14dad8

11 files changed

+44
-53
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-python@v5
1414
- name: Install dependencies
15-
run: pipx install copier poetry
15+
run: pipx install copier uv
1616
- name: Run test
1717
run: |
1818
git config --global user.name "GitHub Action"
1919
git config --global user.email "[email protected]"
2020
copier copy --trust -f -d docker=True -d docs=True . build/ && cd build/
21-
poetry run task lint
21+
uv run task lint
2222
- name: Push rendered project
2323
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
2424
run: |

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ build:
99

1010
.PHONY: test
1111
test:
12-
@poetry -C build run task lint
13-
@poetry -C build run task test -q
12+
@uv --directory=build run task lint
13+
@uv --directory=build run task test -q
1414

1515
.PHONY: release
1616
release:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ uvx copier copy --trust gh:branchvincent/python-template .
1212

1313
## Features
1414

15-
- Package manager: [Poetry](https://python-poetry.org/)
15+
- Package manager: [uv](https://docs.astral.sh/uv/)
1616
- Formatting: [Ruff](https://docs.astral.sh/ruff/formatter/)
1717
- Testing: [pytest](https://docs.pytest.org/en/latest/)
1818
- Linting: [Ruff](https://docs.astral.sh/ruff/linter/) and [pre-commit](https://pre-commit.com/)

copier.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _exclude:
3939
_skip_if_exists:
4040
- pyproject.toml
4141
_tasks:
42-
- "[ -d .git ] || poetry install -q"
42+
- "[ -d .git ] || uv sync -q"
4343
- "[ -d .git ] || git init -q && git add --all && git commit -qm 'initial commit'"
4444
- "[ -d .git ] || touch .envrc"
4545
- printf "To create your repo:\n gh repo create -y {{repo_username}}/{{repo_name}} {% if private %}--private{% else %}--public{% endif %}\n"

src/.github/workflows/ci.yaml.jinja

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Set up Poetry
15-
run: pipx install poetry
14+
- name: Set up uv
15+
run: pipx install uv
1616
- uses: actions/setup-python@v5
1717
with:
1818
python-version: 3.13
19-
cache: poetry
2019
- name: Install package
21-
run: poetry install
20+
run: uv sync --frozen
2221
- name: Run linters
23-
run: poetry run task lint
22+
run: uv run task lint
2423
- name: Run tests
25-
run: poetry run task test
24+
run: uv run task test
2625

2726
release:
2827
needs: build
@@ -51,9 +50,9 @@ jobs:
5150
{% if not private -%}
5251
- name: Publish to PyPI
5352
if: steps.version.outputs.skipped == 'false'
54-
run: pipx run poetry publish --build
53+
run: uv build && uv publish
5554
env:
56-
POETRY_PYPI_TOKEN_PYPI: {% raw %}${{ secrets.PYPI_TOKEN }}{% endraw %}
55+
UV_PUBLISH_TOKEN: {% raw %}${{ secrets.PYPI_TOKEN }}{% endraw %}
5756
{% endif -%}
5857
{% if docker -%}
5958
- uses: satackey/[email protected]

src/.github/workflows/{% if docs %}docs.yaml{% endif %}

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ jobs:
1212
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
15-
- name: Set up Poetry
16-
run: pipx install poetry
15+
- name: Set up uv
16+
run: pipx install uv
1717
- uses: actions/setup-python@v5
1818
with:
1919
python-version: 3.13
20-
cache: poetry
2120
- name: Install package
22-
run: poetry install
21+
run: uv sync --frozen --all-extras
2322
- name: Publish docs
24-
run: poetry run mkdocs gh-deploy
23+
run: uv run mkdocs gh-deploy

src/.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ repos:
33
hooks:
44
- id: ruff-format
55
name: ruff-format
6-
entry: poetry run ruff format
6+
entry: uv run ruff format
77
require_serial: true
88
language: system
99
types: [python]
1010
- id: ruff-check
1111
name: ruff-check
12-
entry: poetry run ruff check
12+
entry: uv run ruff check
1313
require_serial: true
1414
language: system
1515
types: [python]
1616
- id: mypy
1717
name: mypy
18-
entry: poetry run mypy
18+
entry: uv run mypy
1919
require_serial: true
2020
language: system
2121
types: [python]

src/CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Contributing
22

3-
Before getting started, install [Poetry](https://python-poetry.org/docs/#installation).
3+
Before getting started, install [uv](https://docs.astral.sh/uv/getting-started/installation).
44

55
## Getting Started
66

77
To install the project:
88

99
```sh
10-
poetry install
10+
uv sync
1111
```
1212

1313
Optionally, you can also install [pre-commit](https://pre-commit.com/) hooks:
1414

1515
```sh
16-
poetry run pre-commit install
16+
uv run pre-commit install
1717
```
1818

1919
Lastly, to see common tasks with [taskipy](https://github.com/illBeRoy/taskipy):
2020

2121
```sh
22-
poetry run task --list
22+
uv run task --list
2323
```
2424

2525
## Linting
@@ -32,15 +32,15 @@ To ensure code quality, we use the following tools:
3232
To run these:
3333

3434
```sh
35-
poetry run task lint
35+
uv run task lint
3636
```
3737

3838
## Testing
3939

4040
To run tests via [pytest](https://docs.pytest.org/en/latest/):
4141

4242
```sh
43-
poetry run task test
43+
uv run task test
4444
```
4545

4646
## Releasing

src/pyproject.toml.jinja

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@ version = "0.1.0"
44
description = "{{project_description}}"
55
readme = "README.md"
66
authors = [{ name = "{{author_name}}", email = "{{author_email}}" }]
7-
requires-python = ">=3.10,<4.0"
7+
requires-python = ">=3.10"
88
dependencies = []
99
urls.repository = "https://github.com/{{repo_username}}/{{repo_name}}"
1010
{%- if private %}
1111
classifiers = ["Private :: Do Not Upload"]
1212
{%- endif %}
1313

14-
[tool.poetry.group.dev.dependencies]
15-
{% if docs -%}
16-
mkdocs = ">=1"
17-
mkdocs-material = ">=9"
18-
{% endif -%}
19-
mypy = ">=1"
20-
pre-commit = ">=4"
21-
pytest = ">=8"
22-
ruff = ">=0.11"
23-
taskipy = ">=1"
14+
[dependency-groups]
15+
{%- if docs %}
16+
docs = ["mkdocs", "mkdocs-material"]
17+
{%- endif %}
18+
dev = ["mypy", "pre-commit", "pytest", "ruff", "taskipy"]
2419

2520
[tool.taskipy.tasks]
2621
clean = { cmd = "rm -rf .*_cache/ dist/", help = "Remove build artifacts" }
@@ -30,17 +25,17 @@ docs = { cmd = "mkdocs serve -f docs/mkdocs.yaml", help = "Serve documentation"}
3025
lint = { cmd = "pre-commit run --all-files", help = "Run linters and formatters" }
3126
test = { cmd = "pytest", help = "Run tests" }
3227

33-
[tool.ruff]
34-
fix = true
35-
lint = { select = ["B", "E", "F", "I", "SIM", "UP"] }
36-
3728
[tool.mypy]
3829
strict = true
3930
ignore_missing_imports = true
4031

4132
[tool.pytest.ini_options]
4233
testpaths = ["tests"]
4334

35+
[tool.ruff]
36+
fix = true
37+
lint = { select = ["B", "E", "F", "I", "SIM", "UP"] }
38+
4439
[build-system]
45-
requires = ["poetry-core>=2.0"]
46-
build-backend = "poetry.core.masonry.api"
40+
requires = ["flit_core >=3.2,<4"]
41+
build-backend = "flit_core.buildapi"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
22
!src/*
3+
!README.md
34
!pyproject.toml
4-
!poetry.lock
5+
!uv.lock

0 commit comments

Comments
 (0)