Skip to content

Commit

Permalink
Add tox as a dev dependency to test perfsephone across different ve…
Browse files Browse the repository at this point in the history
…rsions of python (#4)

* Add `tox` as a dev dependency to test perfsephone across different versions of python

* Add section in readme documenting how tox can be used to run tests
  • Loading branch information
lucamuscat authored Dec 22, 2024
1 parent c0e1e00 commit e663c8f
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ Although profiling tools for python already exist, they either:
* Do not integrate well with pytest, leaving out essential data, such as time spent in test setup,
test teardown, and collection time;
* Generate too much cruft. Perfsephone filters out call stacks related to pytest internals, which
cannot be optimized without optimizing pytest itself.
cannot be optimized without optimizing pytest itself.

# Development
Perfsephone's dependencies is managed using [*poetry*](https://python-poetry.org/docs/#installation).

## Tests
In order to run the project's unit tests & linting suite, run the following command:
`poetry run tox -p`
133 changes: 132 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pyinstrument = "^5.0.0"
ruff = "^0.8"
mypy = "^1.13.0"
pytest = "^8.3.3"
tox = "^4.23.2"

[build-system]
requires = ["poetry-core"]
Expand Down
33 changes: 33 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[tox]
requires =
tox>=4
env_list = 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, test, lint, format, mypy

commands_pre =
poetry install --no-root --sync

[testenv]
allowlist_externals = poetry

commands =
poetry run pytest

[testenv:format]
description = check project formatting
skip_install = true
allowlist_externals = poetry
commands =
poetry run ruff format


[testenv:lint]
description = check project linting
skip_install = true
allowlist_externals = poetry
commands =
poetry run ruff check

[testenv:mypy]
allowlist_externals = poetry
commands =
poetry run mypy .

0 comments on commit e663c8f

Please sign in to comment.