Skip to content

Commit d8bb8ee

Browse files
committed
Use dependency-groups for dev, tests, and typing dependencies.
1 parent acd9543 commit d8bb8ee

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

pyproject.toml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ Changelog = "https://reader.readthedocs.io/en/latest/changelog.html"
5858

5959
[project.optional-dependencies]
6060

61-
# STABLE
62-
63-
search = [] # empty since 2.4, kept to avoid breaking dependents
64-
readtime = [] # empty since 3.1, kept to avoid breaking dependents
65-
6661
# UNSTABLE
6762

6863
cli = [
@@ -81,8 +76,6 @@ app = [
8176
"jinja2-fragments",
8277
]
8378

84-
# UNSTABLE PLUGINS
85-
8679
# mushed together for convenience
8780
unstable-plugins = [
8881
# enclosure-tags
@@ -98,9 +91,13 @@ unstable-plugins = [
9891
"tabulate",
9992
]
10093

101-
# DEVELOPMENT
94+
# DEPRECATED, kept until 4.0 to avoid breaking dependents
95+
96+
search = [] # empty since 2.4
97+
readtime = [] # empty since 3.1
98+
99+
[dependency-groups]
102100

103-
# run tests under one interpreter
104101
tests = [
105102
"pytest>=4",
106103
"pytest-randomly",
@@ -119,13 +116,14 @@ tests = [
119116
"html5lib",
120117
# for bench.py
121118
'numpy; (implementation_name != "pypy" and os_name == "posix" and python_version <= "3.12")',
122-
# mypy does not work on pypy (yet).
123-
'mypy; implementation_name != "pypy"',
119+
]
120+
121+
typing = [
122+
'mypy',
124123
"types-requests",
125124
"types-beautifulsoup4",
126125
]
127126

128-
# build docs
129127
docs = [
130128
"sphinx",
131129
# listing 1.3.0rc1 explicitly until 1.3 is released
@@ -139,9 +137,7 @@ docs = [
139137
"setuptools",
140138
]
141139

142-
# things needed to develop / test locally / make releases
143140
dev = [
144-
"reader[cli,app,unstable-plugins,tests,docs]",
145141
"tox",
146142
"pre-commit",
147143
"build",

run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ readonly SCRIPT="$PROJECT_ROOT/$( basename "$0" )"
3232

3333

3434
function install-dev {
35-
pip install -e '.[dev]' --upgrade --upgrade-strategy=eager
35+
pip install \
36+
--editable '.[cli,app,unstable-plugins]' \
37+
--group dev --group tests --group typing \
38+
--upgrade --upgrade-strategy eager
3639
pre-commit install --install-hooks
3740
}
3841

@@ -157,7 +160,9 @@ function clean-pyc {
157160

158161

159162
function ci-install {
160-
pip install -e '.[cli,app,tests,docs,unstable-plugins]'
163+
pip install \
164+
--editable '.[cli,app,unstable-plugins]' \
165+
--group tests --group typing
161166
}
162167

163168
function ci-run {

tox.ini

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ envlist = coverage-clean,py{313,312,311,py311},coverage-report,typing,docs
33
skip_missing_interpreters = true
44

55
[testenv]
6-
extras =
7-
cli
8-
app
9-
tests
10-
unstable-plugins
11-
6+
extras = cli, app, unstable-plugins
7+
dependency_groups = tests
128
allowlist_externals =
139
./run.sh
1410

@@ -29,12 +25,9 @@ skip_install = true
2925
commands = ./run.sh coverage-report
3026

3127
[testenv:typing]
32-
extras =
33-
search
34-
tests
28+
dependency_groups = typing
3529
commands = ./run.sh typing
3630

3731
[testenv:docs]
38-
extras =
39-
docs
32+
dependency_groups = docs
4033
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

0 commit comments

Comments
 (0)