Skip to content

Commit 3a2ca78

Browse files
Merge pull request #178 from Doist/uv
Migrate from poetry to uv
2 parents bd5e67d + 4448757 commit 3a2ca78

File tree

9 files changed

+455
-1281
lines changed

9 files changed

+455
-1281
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: tests
22

33
on: [pull_request, workflow_dispatch]
44

5-
env:
6-
POETRY_HOME: ${{ github.workspace }}/.poetry
7-
85
jobs:
96
build-test:
107
runs-on: ubuntu-latest
@@ -14,29 +11,18 @@ jobs:
1411
with:
1512
fetch-depth: 1
1613

17-
- name: Read Python version
18-
id: python-version
19-
run: echo "version=$(cat .python-version)" >> $GITHUB_OUTPUT
20-
21-
- name: Read Poetry version
22-
id: poetry-version
23-
run: echo "version=$(cat .poetry-version)" >> $GITHUB_OUTPUT
24-
2514
- name: Set up Python
2615
uses: actions/setup-python@v5
2716
with:
28-
python-version: ${{ steps.python-version.outputs.version }}
17+
python-version-file: pyproject.toml
2918

30-
- name: Set up Poetry
31-
run: |
32-
python3 -m venv $POETRY_HOME
33-
$POETRY_HOME/bin/pip install "poetry==${{ steps.poetry-version.outputs.version }}"
19+
- name: Set up uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
version: 0.6.11
3423

35-
- name: Install dependencies
36-
run: |
37-
$POETRY_HOME/bin/poetry install --with dev
24+
- name: Install project
25+
run: uv sync --group dev
3826

3927
- name: Test with pytest
40-
run: |
41-
set -ex
42-
$POETRY_HOME/bin/poetry run pytest
28+
run: uv run pytest

.github/workflows/publish.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
tags:
66
- "v*"
77

8-
env:
9-
POETRY_HOME: ${{ github.workspace }}/.poetry
10-
118
jobs:
129
build-test:
1310
runs-on: ubuntu-latest
@@ -17,32 +14,22 @@ jobs:
1714
with:
1815
fetch-depth: 1
1916

20-
- name: Read Python version
21-
id: python-version
22-
run: echo "version=$(cat .python-version)" >> $GITHUB_OUTPUT
23-
24-
- name: Read Poetry version
25-
id: poetry-version
26-
run: echo "version=$(cat .poetry-version)" >> $GITHUB_OUTPUT
27-
2817
- name: Set up Python
2918
uses: actions/setup-python@v5
3019
with:
31-
python-version: ${{ steps.python-version.outputs.version }}
20+
python-version-file: pyproject.toml
3221

33-
- name: Set up Poetry
34-
run: |
35-
python3 -m venv $POETRY_HOME
36-
$POETRY_HOME/bin/pip install "poetry==${{ steps.poetry-version.outputs.version }}"
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
version: 0.6.11
3726

38-
- name: Install dependencies
39-
run: |
40-
$POETRY_HOME/bin/poetry install --with publishing
27+
- name: Install project
28+
run: uv sync --group publishing
4129

4230
- name: Build and publish to PyPI
4331
env:
44-
TWINE_USERNAME: __token__
45-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
4633
run: |
47-
$POETRY_HOME/bin/poetry run python -m build
48-
$POETRY_HOME/bin/poetry run python -m twine upload dist/*
34+
uv build
35+
uv publish

.poetry-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ repos:
2525
# Run the formatter
2626
- id: ruff-format
2727

28+
- repo: https://github.com/astral-sh/uv-pre-commit
29+
rev: 0.6.11
30+
hooks:
31+
- id: uv-lock
32+
2833
- repo: local
2934
hooks:
3035
- id: mypy
3136
name: mypy
32-
entry: poetry run mypy
37+
entry: uv run mypy
3338
language: system
3439
"types_or": [python, pyi]
3540
args: ["--scripts-are-modules"]

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ This is the official Python API client for the Todoist REST API.
44

55
### Installation
66

7-
The repository can be included as a [Poetry](https://python-poetry.org/) dependency in `pyproject.toml`.
7+
The repository can be included as a dependency in `pyproject.toml`.
88
It is best to integrate to a release tag to ensure a stable dependency:
99

1010
```toml
11-
[tool.poetry.dependencies]
12-
todoist-api-python = "^v2.0.0"
11+
dependencies = [
12+
...
13+
"todoist-api-python>=8.0.0,<9",
14+
...
15+
]
1316
```
1417

1518
### Supported Python Versions
1619

17-
Python 3.9 is fully supported and tested, and while it may work with other Python 3 versions, we do not test for them.
20+
Python 3.13 is fully supported and tested, and while it should work with other Python 3 versions, we do not test for them.
1821

1922
### Usage
2023

@@ -74,19 +77,19 @@ For more detailed reference documentation, have a look at the [API documentation
7477
To install Python dependencies:
7578

7679
```sh
77-
$ poetry install
80+
$ uv sync
7881
```
7982

8083
To install pre-commit:
8184

8285
```sh
83-
$ poetry run pre-commit install
86+
$ uv run pre-commit install
8487
```
8588

8689
You can try your changes via REPL by running:
8790

8891
```sh
89-
$ poetry run python
92+
$ uv run python
9093
```
9194

9295
You can then import the library as described in [Usage](#usage) without having to create a file.

0 commit comments

Comments
 (0)