-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce tox to automate tasks (#78)
* Introduce tox.ini for project automation * Update documentation
- Loading branch information
Showing
5 changed files
with
126 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[tox] | ||
requires = | ||
tox>=4 | ||
envlist = lint, type, py{38,39,310,311,312} | ||
|
||
[testenv] | ||
description = run unit tests | ||
commands_pre = | ||
pip install ".[test]" | ||
commands = | ||
pytest | ||
|
||
[testenv:lint] | ||
description = run linters with formatting | ||
allowlist_externals = | ||
find | ||
npx | ||
commands_pre = | ||
pip install ".[lint]" | ||
commands = | ||
black . | ||
isort . | ||
find ./src/mmh3 -name '*.[ch]' -exec clang-format -i {} + | ||
npx prettier --write . | ||
pylint --recursive=y . | ||
npx markdownlint --config .markdown-lint.yml \ | ||
--ignore-path .gitignore **/*.md | ||
|
||
[testenv:type] | ||
description = run type checks | ||
commands_pre = | ||
pip install ".[type]" | ||
commands = | ||
mypy --strict tests | ||
|
||
[testenv:docs] | ||
description = run documentation build | ||
allowlist_externals = | ||
make | ||
commands_pre = | ||
pip install ".[docs]" | ||
commands = | ||
make -C docs html | ||
|
||
[testenv:build-cfiles] | ||
allowlist_externals = | ||
find | ||
git | ||
commands_pre = | ||
pip install ".[lint]" | ||
commands = | ||
git submodule update --init | ||
python util/refresh.py | ||
find ./src/mmh3 -name '*.[ch]' -exec clang-format -i {} + |