Skip to content

Commit 2c428db

Browse files
authored
Update metadata, migrate to uv, test on 3.14 and free-threaded (#208)
* Update project metadata, * migrate to uv * test on 3.14 and free-threaded * Fix flag for lowest-compat * Use resolution strategy lowest-direct * Update contributing guide * Update RTD build config
1 parent 7ad9c64 commit 2c428db

File tree

7 files changed

+73
-80
lines changed

7 files changed

+73
-80
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,58 +11,67 @@ permissions:
1111
contents: read
1212

1313
env:
14-
UV_SYSTEM_PYTHON: 1
14+
UV_MANAGED_PYTHON: 1
1515

1616
jobs:
1717
test:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
22+
python-version: [
23+
"3.9",
24+
"3.10",
25+
"3.11",
26+
"3.12",
27+
"3.13",
28+
"3.13t",
29+
"3.14",
30+
"3.14t",
31+
]
2332
os: [macOS-latest, ubuntu-latest, windows-latest]
2433

2534
steps:
2635
- name: Checkout
2736
uses: actions/checkout@v5
28-
- name: Set Up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v6
37+
- uses: astral-sh/setup-uv@v7
3038
with:
3139
python-version: ${{ matrix.python-version }}
32-
allow-prereleases: true
33-
- uses: hynek/setup-cached-uv@v2
34-
with:
35-
cache-dependency-path: pyproject.toml
36-
- name: Install
37-
run: make EXTRAS=dev install
40+
- run: uv sync
3841
- name: Test
3942
run: make test
4043
- name: Lint
4144
run: make lint
4245

43-
build:
44-
needs: test
46+
compat:
47+
env:
48+
UV_RESOLUTION: lowest-direct
4549
runs-on: ubuntu-latest
4650
steps:
4751
- uses: actions/checkout@v5
48-
- uses: actions/setup-python@v6
52+
- uses: astral-sh/setup-uv@v7
4953
with:
50-
python-version: '3.12'
51-
- uses: hynek/setup-cached-uv@v2
54+
python-version: "3.9"
55+
- run: uv sync
56+
- run: make test lint
57+
58+
build:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v5
62+
- uses: astral-sh/setup-uv@v7
5263
with:
53-
cache-dependency-path: pyproject.toml
54-
- name: Install
55-
run: make install
56-
- name: Build
57-
run: python -m build
64+
python-version: "3.14"
65+
- run: uv sync
66+
- run: uv build
5867
- name: Upload
5968
uses: actions/upload-artifact@v5
6069
with:
6170
name: sdist
6271
path: dist
63-
72+
6473
publish:
65-
needs: build
74+
needs: [build, compat, test]
6675
runs-on: ubuntu-latest
6776
if: startsWith(github.ref, 'refs/tags/v')
6877
permissions:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
uv.lock
12
html/
23

34
# Byte-compiled / optimized / DLL files

.readthedocs.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ version: 2
22
sphinx:
33
configuration: docs/conf.py
44
build:
5-
os: ubuntu-22.04
5+
os: ubuntu-24.04
66
tools:
7-
python: "3.10"
8-
python:
9-
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
13-
- docs
7+
python: "3.13"
8+
jobs:
9+
install:
10+
- pip install --upgrade pip
11+
- pip install --group 'docs'

CONTRIBUTING.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
## Preparation
44

5-
You'll need to have Python 3.8 or newer available for testing.
6-
I recommend using [pyenv][] for this:
5+
aioitertools uses [uv][] to manage environments and dependencies, and `make`
6+
to run tests and linters.
7+
8+
You'll need to have Python 3.9 or newer available for testing:
79

810
```sh
9-
$ pyenv install 3.12
10-
$ pyenv shell 3.12
11+
$ uv python pin 3.14
1112
```
1213

13-
## Setup
14+
## Testing
1415

15-
Create a fresh development enviroment, and install the
16-
appropriate tools and dependencies:
16+
Run the test suite:
1717

18-
```sh
19-
$ cd <path/to/aioitertools>
20-
$ make venv
21-
$ source .venv/bin/activate
18+
```shell-session
19+
$ make test
20+
```
21+
22+
Run the linters:
23+
24+
```shell-session
25+
$ make lint
2226
```
2327

2428
## Submitting
@@ -32,4 +36,4 @@ that you have done the following:
3236
* Used `make format` to format code appropriately
3337
* Validated and tested code with `make test lint`
3438

35-
[pyenv]: https://github.com/pyenv/pyenv
39+
[uv]: https://docs.astral.sh/uv/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Implementation of itertools, builtins, and more for AsyncIO and mixed-type itera
1212
Install
1313
-------
1414

15-
aioitertools requires Python 3.8 or newer.
15+
aioitertools requires Python 3.9 or newer.
1616
You can install it from PyPI:
1717

1818
```sh

makefile

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,24 @@
11
PKG:=aioitertools
2-
EXTRAS:=dev,docs
32

4-
UV:=$(shell uv --version)
5-
ifdef UV
6-
VENV:=uv venv
7-
PIP:=uv pip
8-
else
9-
VENV:=python -m venv
10-
PIP:=python -m pip
11-
endif
12-
13-
.venv:
14-
$(VENV) .venv
15-
16-
venv: .venv
17-
source .venv/bin/activate && make install
18-
echo 'run `source .venv/bin/activate` to use virtualenv'
19-
20-
install:
21-
$(PIP) install -Ue .[$(EXTRAS)]
22-
23-
release: lint test clean
24-
flit publish
3+
all: format test lint
254

265
format:
27-
python -m ufmt format $(PKG)
6+
uv run ufmt format $(PKG)
287

298
lint:
30-
python -m flake8 $(PKG)
31-
python -m ufmt check $(PKG)
9+
uv run flake8 $(PKG)
10+
uv run ufmt check $(PKG)
3211

3312
test:
34-
python -m coverage run -m $(PKG).tests
35-
python -m coverage report
36-
python -m mypy -p $(PKG)
13+
uv run coverage run -m $(PKG).tests
14+
uv run coverage report
15+
uv run mypy -p $(PKG)
3716

3817
html: .venv README.md docs/*
39-
source .venv/bin/activate && sphinx-build -b html docs html
18+
uv run --group docs sphinx-build -b html docs html
4019

4120
clean:
42-
rm -rf .mypy_cache build dist html README MANIFEST *.egg-info
21+
rm -rf .mypy_cache uv.lock build dist html README MANIFEST *.egg-info
4322

4423
distclean: clean
4524
rm -rf .venv

pyproject.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
[build-system]
2-
requires = ["flit_core >=3.8,<4"]
2+
requires = ["flit_core >=3.11,<4"]
33
build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "aioitertools"
77
readme = "README.md"
88
authors = [{ name = "Amethyst Reese", email = "amethyst@n7.gg" }]
9-
license = { file = "LICENSE" }
9+
license = "MIT"
10+
license-files = ["LICENSE"]
1011
dynamic = ["version", "description"]
1112
classifiers = [
12-
"Development Status :: 4 - Beta",
1313
"Framework :: AsyncIO",
1414
"Intended Audience :: Developers",
15-
"License :: OSI Approved :: MIT License",
1615
"Topic :: Software Development :: Libraries",
1716
]
18-
requires-python = ">=3.8"
17+
requires-python = ">=3.9"
1918
dependencies = ["typing_extensions>=4.0; python_version < '3.10'"]
2019

21-
[project.optional-dependencies]
20+
[dependency-groups]
2221
dev = [
2322
"attribution==1.8.0",
2423
"black==24.8.0",
25-
"build>=1.2",
2624
"coverage==7.6.1",
2725
"flake8==7.1.1",
2826
"flit==3.9.0",
@@ -37,6 +35,7 @@ docs = [
3735

3836
[project.urls]
3937
Documentation = "https://aioitertools.omnilib.dev"
38+
Changelog = "https://aioitertools.omnilib.dev/en/latest/changelog.html"
4039
Github = "https://github.com/omnilib/aioitertools"
4140

4241
[tool.flit.sdist]
@@ -62,3 +61,6 @@ skip_covered = true
6261
[tool.mypy]
6362
# strict = true
6463
ignore_missing_imports = true
64+
65+
[tool.uv.dependency-groups]
66+
docs = {requires-python=">=3.10"}

0 commit comments

Comments
 (0)