Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: tests

on: [pull_request, workflow_dispatch]

env:
POETRY_HOME: ${{ github.workspace }}/.poetry

jobs:
build-test:
runs-on: ubuntu-latest
Expand All @@ -14,29 +11,18 @@ jobs:
with:
fetch-depth: 1

- name: Read Python version
id: python-version
run: echo "version=$(cat .python-version)" >> $GITHUB_OUTPUT

- name: Read Poetry version
id: poetry-version
run: echo "version=$(cat .poetry-version)" >> $GITHUB_OUTPUT

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ steps.python-version.outputs.version }}
python-version-file: pyproject.toml

- name: Set up Poetry
run: |
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install "poetry==${{ steps.poetry-version.outputs.version }}"
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.11

- name: Install dependencies
run: |
$POETRY_HOME/bin/poetry install --with dev
- name: Install project
run: uv sync --group dev

- name: Test with pytest
run: |
set -ex
$POETRY_HOME/bin/poetry run pytest
run: uv run pytest
33 changes: 10 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- "v*"

env:
POETRY_HOME: ${{ github.workspace }}/.poetry

jobs:
build-test:
runs-on: ubuntu-latest
Expand All @@ -17,32 +14,22 @@ jobs:
with:
fetch-depth: 1

- name: Read Python version
id: python-version
run: echo "version=$(cat .python-version)" >> $GITHUB_OUTPUT

- name: Read Poetry version
id: poetry-version
run: echo "version=$(cat .poetry-version)" >> $GITHUB_OUTPUT

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ steps.python-version.outputs.version }}
python-version-file: pyproject.toml

- name: Set up Poetry
run: |
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install "poetry==${{ steps.poetry-version.outputs.version }}"
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.11

- name: Install dependencies
run: |
$POETRY_HOME/bin/poetry install --with publishing
- name: Install project
run: uv sync --group publishing

- name: Build and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
$POETRY_HOME/bin/poetry run python -m build
$POETRY_HOME/bin/poetry run python -m twine upload dist/*
uv build
uv publish
1 change: 0 additions & 1 deletion .poetry-version

This file was deleted.

7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ repos:
# Run the formatter
- id: ruff-format

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.6.11
hooks:
- id: uv-lock

- repo: local
hooks:
- id: mypy
name: mypy
entry: poetry run mypy
entry: uv run mypy
language: system
"types_or": [python, pyi]
args: ["--scripts-are-modules"]
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ This is the official Python API client for the Todoist REST API.

### Installation

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

```toml
[tool.poetry.dependencies]
todoist-api-python = "^v2.0.0"
dependencies = [
...
"todoist-api-python>=8.0.0,<9",
...
]
```

### Supported Python Versions

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

### Usage

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

```sh
$ poetry install
$ uv sync
```

To install pre-commit:

```sh
$ poetry run pre-commit install
$ uv run pre-commit install
```

You can try your changes via REPL by running:

```sh
$ poetry run python
$ uv run python
```

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