Skip to content

Commit 14698d2

Browse files
authored
Switch from requirements files to pyproject.toml (#2305)
1 parent 383e12b commit 14698d2

7 files changed

Lines changed: 34 additions & 23 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
pip install --upgrade pip
24-
pip install -r docs/requirements.txt
24+
pip install --group docs
2525
- name: Build the documentation
2626
run: make -C docs html

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v6
18-
- name: Set up Python 3
19-
uses: actions/setup-python@v6
18+
- uses: actions/setup-python@v6
2019
with:
21-
python-version: 3
20+
python-version: "3.14"
2221
cache: "pip"
23-
cache-dependency-path: "test-requirements.txt"
2422

2523
- name: Install dependencies
2624
run: |
2725
pip install --upgrade pip
28-
pip install -r test-requirements.txt
26+
pip install --group test
2927
3028
- name: Lint implementation
3129
run: flake8

.readthedocs.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
version: 2
55

66
build:
7-
os: ubuntu-22.04
7+
os: ubuntu-26.04
88
tools:
99
python: "3"
10+
jobs:
11+
install:
12+
- uv sync --group docs
1013

1114
sphinx:
1215
configuration: docs/conf.py
1316

1417
python:
1518
install:
16-
- requirements: docs/requirements.txt
19+
- method: uv
20+
command: sync

docs/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# from the environment for the first two.
66
SOURCEDIR = .
77
SOURCES =
8+
ROOTDIR = ..
89
BUILDDIR = _build
910
PYTHON = python3
1011
VENVDIR = ./venv
@@ -38,8 +39,8 @@ text: build
3839

3940
venv:
4041
$(PYTHON) -m venv $(VENVDIR)
41-
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools
42-
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt
42+
$(VENVDIR)/bin/python3 -m pip install -U pip
43+
$(VENVDIR)/bin/python3 -m pip install --group $(ROOTDIR)/pyproject.toml:docs
4344
@echo "The venv has been created in the $(VENVDIR) directory"
4445

4546
# Catch-all target: route all unknown targets to Sphinx using the new

docs/requirements.txt

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

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[project]
2+
name = "typing"
3+
version = "1" # dummy
4+
requires-python = ">= 3.12" # for building the documentation etc.
5+
6+
[dependency-groups]
7+
test = [
8+
"flake8",
9+
"flake8-bugbear",
10+
"flake8-pyi",
11+
]
12+
docs = [
13+
# Sphinx version is pinned so that new versions that introduce new warnings
14+
# won't suddenly cause build failures. Updating the version is fine as long
15+
# as no warnings are raised by doing so.
16+
"sphinx==9.1.0",
17+
18+
# The theme used by the documentation is stored separately, so we need
19+
# to install that as well.
20+
"python-docs-theme",
21+
]

test-requirements.txt

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

0 commit comments

Comments
 (0)