Skip to content

Commit 0e3578b

Browse files
authored
Merge pull request #766 from LincolnPuzey/use_dependency_groups
Use PEP-735 Dependency groups instead of [dev] extra
2 parents 62b2e9b + 5a95ece commit 0e3578b

File tree

5 files changed

+67
-27
lines changed

5 files changed

+67
-27
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
sudo apt-get update
5757
sudo apt-get remove libhashkit2 libmemcached11 || true
5858
sudo apt-get install -y libmemcached-dev
59-
- run: pip install -e '.[dev]'
59+
- run: pip install -e '.[all]' --group test
6060
- run: pytest --benchmark-skip
6161
if: ${{ matrix.concurrency == 'cpython' }}
6262
env:

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ those changes to CLEARTYPE SRL. If you cannot or do not want to
1212
reassign those rights, you shouldn't submit a PR. Instead, you should
1313
open an issue and let someone else do that work.
1414

15+
### Local Development
16+
17+
To set up a development environment, it is recommended to:
18+
19+
1. Clone the repository (or your fork of it).
20+
2. Create and active a virtual environment.
21+
3. Install dramatiq in editable mode with all optional extras: `pip install -e ".[all]"`.
22+
4. Install the development dependencies `pip install --group dev`.
23+
1524
### Pull Requests
1625

1726
* Make sure any code changes are covered by tests.

pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22
requires = ["setuptools >= 80.9.0, < 81"]
33
build-backend = "setuptools.build_meta"
44

5+
[dependency-groups]
6+
dev = [
7+
{include-group = "test"},
8+
{include-group = "lint"},
9+
{include-group = "format"},
10+
{include-group = "type-check"},
11+
{include-group = "build"},
12+
{include-group = "docs"},
13+
"bumpversion",
14+
"hiredis",
15+
"twine",
16+
"wheel",
17+
"tox",
18+
]
19+
test = [
20+
"pytest",
21+
"pytest-benchmark[histogram]",
22+
"pytest-cov",
23+
]
24+
lint = [
25+
"flake8",
26+
"flake8-bugbear",
27+
"flake8-quotes",
28+
"isort",
29+
]
30+
format = [
31+
"black",
32+
]
33+
type-check = [
34+
"mypy",
35+
]
36+
build = [
37+
"build",
38+
]
39+
docs = [
40+
"alabaster",
41+
"sphinx",
42+
"sphinxcontrib-napoleon",
43+
]
44+
45+
546
[tool.pytest.ini_options]
647
testpaths = "tests"
748
addopts = "--cov dramatiq --cov-report html --benchmark-autosave --benchmark-compare"

setup.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,6 @@ def rel(*xs):
6464
}
6565

6666
extra_dependencies["all"] = list(set(sum(extra_dependencies.values(), [])))
67-
extra_dependencies["dev"] = extra_dependencies["all"] + [
68-
# Docs
69-
"alabaster",
70-
"sphinx",
71-
"sphinxcontrib-napoleon",
72-
# Linting
73-
"flake8",
74-
"flake8-bugbear",
75-
"flake8-quotes",
76-
"isort",
77-
"mypy",
78-
# Misc
79-
"black",
80-
"bumpversion",
81-
"hiredis",
82-
"twine",
83-
"wheel",
84-
# Testing
85-
"pytest",
86-
"pytest-benchmark[histogram]",
87-
"pytest-cov",
88-
"tox",
89-
]
9067

9168
setup(
9269
name="dramatiq",

tox.ini

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ envlist=
77
[testenv]
88
setenv =
99
PYTHONTRACEMALLOC=1
10+
dependency_groups=
11+
test
1012
extras=
11-
dev
13+
all
1214
commands=
1315
python -Wall -m pytest --benchmark-skip {posargs}
1416
passenv=
@@ -17,22 +19,33 @@ passenv=
1719
[testenv:py{39,310,311,312,313,314}-gevent]
1820
setenv =
1921
PYTHONTRACEMALLOC=1
22+
dependency_groups=
23+
test
2024
extras=
21-
dev
25+
all
2226
commands=
2327
python -Wall {toxinidir}/pytest-gevent.py --benchmark-skip {posargs}
2428
passenv=
2529
TRAVIS
2630

2731
[testenv:docs]
32+
dependency_groups=
33+
docs
34+
extras=
35+
all
2836
allowlist_externals=make
2937
changedir=docs
3038
commands=
3139
make html
3240

3341
[testenv:lint]
42+
dependency_groups=
43+
lint
44+
format
45+
type-check
46+
test
3447
extras =
35-
dev
48+
all
3649
commands=
3750
black --check {toxinidir}
3851
flake8 {toxinidir}/dramatiq {toxinidir}/examples {toxinidir}/tests

0 commit comments

Comments
 (0)