Skip to content

Commit b73fea2

Browse files
authored
Migrate project configuration to pyproject.toml and uv (#455)
1 parent 2913790 commit b73fea2

File tree

10 files changed

+2284
-137
lines changed

10 files changed

+2284
-137
lines changed

.github/workflows/ci-cd.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ on: # yamllint disable-line rule:truthy
1515

1616
env:
1717
FORCE_COLOR: "1" # Make tools pretty.
18-
PIP_DISABLE_PIP_VERSION_CHECK: "1"
19-
PIP_NO_PYTHON_VERSION_WARNING: "1"
2018
PYTHON_LATEST: "3.13"
2119

2220
# For re-actors/checkout-python-sdist
@@ -33,15 +31,12 @@ jobs:
3331
uses: actions/checkout@v6
3432
with:
3533
fetch-depth: 0
36-
- name: Set up Python
37-
uses: actions/setup-python@v6
34+
- name: Install uv and Python
35+
uses: astral-sh/setup-uv@v5
3836
with:
3937
python-version: ${{ env.PYTHON_LATEST }}
40-
cache: pip
41-
- run: python -m pip install build
42-
name: Install core libraries for build and install
4338
- name: Build artifacts
44-
run: python -m build
39+
run: uv build
4540
- name: Upload built artifacts for testing
4641
uses: actions/upload-artifact@v6
4742
with:
@@ -65,33 +60,27 @@ jobs:
6560
fail-fast: true
6661
matrix:
6762
python-version:
68-
- "3.9"
6963
- "3.10"
7064
- "3.11"
7165
- "3.12"
7266
- "3.13"
7367
experimental: [false]
7468
# include:
75-
# - python-version: "~3.12.0-0"
69+
# - python-version: "~3.14.0-0"
7670
# experimental: true
7771
steps:
7872
- name: Checkout the source code
7973
uses: actions/checkout@v6
8074
with:
8175
fetch-depth: 0
82-
- name: Set up Python
83-
uses: actions/setup-python@v6
76+
- name: Install uv and Python
77+
uses: astral-sh/setup-uv@v5
8478
with:
8579
python-version: ${{ matrix.python-version }}
86-
cache: pip
87-
cache-dependency-path: |
88-
setup.cfg
89-
requirements-dev.txt
9080
- name: Install dependencies
91-
run: |
92-
pip install -U -r requirements-dev.txt
81+
run: uv sync --group dev
9382
- name: Run tests
94-
run: python -m pytest --cov=aiomonitor -v tests
83+
run: uv run pytest --cov=aiomonitor -v tests
9584
- name: Upload coverage data
9685
uses: codecov/codecov-action@v5
9786

.github/workflows/lint.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on: # yamllint disable-line rule:truthy
88

99
env:
1010
FORCE_COLOR: "1" # Make tools pretty.
11-
PIP_DISABLE_PIP_VERSION_CHECK: "1"
12-
PIP_NO_PYTHON_VERSION_WARNING: "1"
1311
PYTHON_LATEST: "3.11"
1412

1513
jobs:
@@ -22,21 +20,14 @@ jobs:
2220
uses: actions/checkout@v6
2321
with:
2422
fetch-depth: 0
25-
- name: Set up Python
26-
uses: actions/setup-python@v6
23+
- name: Install uv and Python
24+
uses: astral-sh/setup-uv@v5
2725
with:
2826
python-version: ${{ env.PYTHON_LATEST }}
29-
check-latest: true
30-
cache: pip
31-
cache-dependency-path: |
32-
setup.cfg
33-
requirements-dev.txt
3427
- name: Install dependencies
35-
run: |
36-
pip install -U -r requirements-dev.txt
28+
run: uv sync --group dev
3729
- name: Lint with Ruff
38-
run: |
39-
python -m ruff check
30+
run: uv run ruff check
4031

4132
typecheck-mypy:
4233
name: Check typing and annotations
@@ -46,19 +37,13 @@ jobs:
4637
uses: actions/checkout@v6
4738
with:
4839
fetch-depth: 0
49-
- name: Set up Python
50-
uses: actions/setup-python@v6
40+
- name: Install uv and Python
41+
uses: astral-sh/setup-uv@v5
5142
with:
5243
python-version: ${{ env.PYTHON_LATEST }}
53-
check-latest: true
54-
cache: pip
55-
cache-dependency-path: |
56-
setup.cfg
57-
requirements-dev.txt
5844
- name: Install dependencies
59-
run: |
60-
pip install -U -r requirements-dev.txt
45+
run: uv sync --group dev
6146
- name: Typecheck with mypy
6247
run: |
6348
echo "::add-matcher::.github/workflows/mypy-matcher.json"
64-
python -m mypy aiomonitor/ examples/ tests/
49+
uv run mypy aiomonitor/ examples/ tests/

.readthedocs.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ sphinx:
1313
formats: []
1414

1515
build:
16-
os: ubuntu-20.04
16+
os: ubuntu-24.04
1717
tools:
1818
python: >- # PyYAML parses it as float but RTD demands an explicit string
19-
3.11
20-
python:
21-
install:
22-
- method: pip
23-
path: .
24-
- requirements: requirements-doc.txt
19+
3.13
20+
jobs:
21+
pre_create_environment:
22+
- asdf plugin add uv
23+
- asdf install uv latest
24+
- asdf global uv latest
25+
create_environment:
26+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
27+
install:
28+
- >-
29+
UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}"
30+
uv sync --frozen --group doc

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

changes/454.enhancement

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrated project configuration to pyproject.toml and uv, consolidating setup.cfg metadata, replacing pip with uv in CI workflows and ReadTheDocs, and updating the minimum Python version to 3.10

pyproject.toml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,90 @@
22
requires = ["setuptools>=69.2", "setuptools_scm[toml]>=8.0"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "aiomonitor"
7+
dynamic = ["version", "readme"]
8+
description = "Adds monitor and Python REPL capabilities for asyncio applications"
9+
keywords = ["asyncio", "aiohttp", "monitor", "debugging", "utility", "devtool"]
10+
license = "Apache-2.0"
11+
authors = [
12+
{name = "Nikolay Novik", email = "nickolainovik@gmail.com"},
13+
]
14+
maintainers = [
15+
{name = "Joongi Kim", email = "me@daybreaker.info"},
16+
]
17+
classifiers = [
18+
"Intended Audience :: Developers",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Operating System :: POSIX",
25+
"Development Status :: 3 - Alpha",
26+
"Framework :: AsyncIO",
27+
]
28+
requires-python = ">=3.10"
29+
dependencies = [
30+
"attrs>=20",
31+
"aiohttp>=3.8.5",
32+
"click>=8.0",
33+
"janus>=1.0",
34+
"jinja2>=3.1.2",
35+
"backports.strenum>=1.2.4; python_version<'3.11'",
36+
"terminaltables",
37+
"pydantic>=2.0.0",
38+
"typing-extensions>=4.1",
39+
"prompt_toolkit>=3.0",
40+
"aioconsole>=0.7.0",
41+
"telnetlib3>=2.0.4",
42+
]
43+
44+
[project.urls]
45+
Homepage = "https://github.com/aio-libs/aiomonitor"
46+
Documentation = "https://aiomonitor.readthedocs.io"
47+
Repository = "https://github.com/aio-libs/aiomonitor"
48+
Issues = "https://github.com/aio-libs/aiomonitor/issues"
49+
Changelog = "https://github.com/aio-libs/aiomonitor/blob/main/CHANGES.rst"
50+
Chat = "https://matrix.to/#/!aio-libs:matrix.org"
51+
52+
[dependency-groups]
53+
dev = [
54+
"aioconsole==0.8.2",
55+
"aiohttp==3.10.10",
56+
"aiotools==1.7.0",
57+
"attrs==24.2.0",
58+
"build==1.3.0",
59+
"docutils==0.21.2",
60+
"ipdb==0.13.13",
61+
"mypy==1.18.2",
62+
"pre-commit==3.5.0",
63+
"pytest==8.3.3",
64+
"pytest-asyncio==0.24.0",
65+
"pytest-cov==7.0.0",
66+
"pytest-sugar==1.1.1",
67+
"ruff==0.14.2",
68+
"terminaltables==3.1.10",
69+
"towncrier==24.8.0",
70+
"types-requests",
71+
"telnetlib3==2.0.4",
72+
"uvloop==0.21.0",
73+
]
74+
doc = [
75+
"sphinx~=7.2",
76+
"sphinx-click~=5.1.0",
77+
"sphinx-autodoc-typehints~=1.25",
78+
]
79+
580
[tool.setuptools_scm]
681
# enables setuptools_scm to provide the dynamic version
782

83+
[tool.setuptools.dynamic]
84+
readme = {file = ["README.rst", "CHANGES.rst"], content-type = "text/x-rst"}
85+
86+
[tool.setuptools.packages.find]
87+
exclude = ["examples*", "tools*"]
88+
889
[tool.ruff]
990
line-length = 88
1091
src = ["aiomonitor", "tests", "examples"]

requirements-dev.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

requirements-doc.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)