Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
sudo apt-get update
sudo apt-get remove libhashkit2 libmemcached11 || true
sudo apt-get install -y libmemcached-dev
- run: pip install -e '.[dev]'
- run: pip install -e '.[all]' --group test
- run: pytest --benchmark-skip
if: ${{ matrix.concurrency == 'cpython' }}
env:
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ those changes to CLEARTYPE SRL. If you cannot or do not want to
reassign those rights, you shouldn't submit a PR. Instead, you should
open an issue and let someone else do that work.

### Local Development

To set up a development environment, it is recommended to:

1. Clone the repository (or your fork of it).
2. Create and active a virtual environment.
3. Install dramatiq in editable mode with all optional extras: `pip install -e ".[all]"`.
4. Install the development dependencies `pip install --group dev`.

### Pull Requests

* Make sure any code changes are covered by tests.
Expand Down
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@
requires = ["setuptools >= 80.9.0, < 81"]
build-backend = "setuptools.build_meta"

[dependency-groups]
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "format"},
{include-group = "type-check"},
{include-group = "build"},
{include-group = "docs"},
"bumpversion",
"hiredis",
"twine",
"wheel",
"tox",
]
test = [
"pytest",
"pytest-benchmark[histogram]",
"pytest-cov",
]
lint = [
"flake8",
"flake8-bugbear",
"flake8-quotes",
"isort",
]
format = [
"black",
]
type-check = [
"mypy",
]
build = [
"build",
]
docs = [
"alabaster",
"sphinx",
"sphinxcontrib-napoleon",
]


[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--cov dramatiq --cov-report html --benchmark-autosave --benchmark-compare"
Expand Down
23 changes: 0 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,6 @@ def rel(*xs):
}

extra_dependencies["all"] = list(set(sum(extra_dependencies.values(), [])))
extra_dependencies["dev"] = extra_dependencies["all"] + [
# Docs
"alabaster",
"sphinx",
"sphinxcontrib-napoleon",
# Linting
"flake8",
"flake8-bugbear",
"flake8-quotes",
"isort",
"mypy",
# Misc
"black",
"bumpversion",
"hiredis",
"twine",
"wheel",
# Testing
"pytest",
"pytest-benchmark[histogram]",
"pytest-cov",
"tox",
]

setup(
name="dramatiq",
Expand Down
19 changes: 16 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ envlist=
[testenv]
setenv =
PYTHONTRACEMALLOC=1
dependency_groups=
test
extras=
dev
all
commands=
python -Wall -m pytest --benchmark-skip {posargs}
passenv=
Expand All @@ -17,22 +19,33 @@ passenv=
[testenv:py{39,310,311,312,313,314}-gevent]
setenv =
PYTHONTRACEMALLOC=1
dependency_groups=
test
extras=
dev
all
commands=
python -Wall {toxinidir}/pytest-gevent.py --benchmark-skip {posargs}
passenv=
TRAVIS

[testenv:docs]
dependency_groups=
docs
extras=
all
allowlist_externals=make
changedir=docs
commands=
make html

[testenv:lint]
dependency_groups=
lint
format
type-check
test
extras =
dev
all
commands=
black --check {toxinidir}
flake8 {toxinidir}/dramatiq {toxinidir}/examples {toxinidir}/tests
Expand Down