diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea7067d..16dd848 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,10 @@ jobs: - name: Run tests run: | - make test + make test SLOW=true + + - name: Upload coverage + run: | bash <(curl -s https://codecov.io/bash) typecheck: diff --git a/.gitignore b/.gitignore index a49b280..ac0ec1f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ config.toml # data data personal +*.csv +*.json +*.txt # generated *.html @@ -32,5 +35,8 @@ htmlcov coverage.xml .coverage +# profiling +prof + # macOS .DS_Store diff --git a/Makefile b/Makefile index 3310fc3..2069c58 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,10 @@ fmt: poetry run black $(SRCDIRS) test: - poetry run python3 -m pytest -v tests/ --cov=quantifiedme --durations=5 + poetry run python3 -m pytest -v tests/ --durations=5 $(if $(NOCAPTURE),--capture=no) \ + --cov=quantifiedme --cov-report xml --cov-report term-missing \ + $(if $(SLOW),,-m "not slow") \ + $(if $(PROFILE),--profile-svg) typecheck: poetry run mypy --ignore-missing-imports --check-untyped-defs $(SRCDIRS) diff --git a/poetry.lock b/poetry.lock index 921ac84..e972b39 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1113,6 +1113,17 @@ protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4 [package.extras] grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] +[[package]] +name = "gprof2dot" +version = "2022.7.29" +description = "Generate a dot graph from the output of several profilers." +optional = false +python-versions = ">=2.7" +files = [ + {file = "gprof2dot-2022.7.29-py2.py3-none-any.whl", hash = "sha256:f165b3851d3c52ee4915eb1bd6cca571e5759823c2cd0f71a79bda93c2dc85d6"}, + {file = "gprof2dot-2022.7.29.tar.gz", hash = "sha256:45b4d298bd36608fccf9511c3fd88a773f7a1abc04d6cd39445b11ba43133ec5"}, +] + [[package]] name = "htmlmin" version = "0.1.12" @@ -3064,6 +3075,25 @@ docs = ["coverage", "ipypublish (>=0.10.7)", "ruamel.yaml", "ruamel.yaml.clib", flake8-plugins = ["flake8-builtins", "flake8-comprehensions", "flake8-docstrings", "import-order"] testing = ["beautifulsoup4 (==4.8.0)", "black (==19.3b0)", "coverage", "pytest-cov", "pytest-regressions"] +[[package]] +name = "pytest-profiling" +version = "1.7.0" +description = "Profiling plugin for py.test" +optional = false +python-versions = "*" +files = [ + {file = "pytest-profiling-1.7.0.tar.gz", hash = "sha256:93938f147662225d2b8bd5af89587b979652426a8a6ffd7e73ec4a23e24b7f29"}, + {file = "pytest_profiling-1.7.0-py2.py3-none-any.whl", hash = "sha256:999cc9ac94f2e528e3f5d43465da277429984a1c237ae9818f8cfd0b06acb019"}, +] + +[package.dependencies] +gprof2dot = "*" +pytest = "*" +six = "*" + +[package.extras] +tests = ["pytest-virtualenv"] + [[package]] name = "pytest-xdist" version = "3.3.1" @@ -4298,4 +4328,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10, <3.12" -content-hash = "e0baf3a107d66fd6da067e227e2bf77cfe55968b4528263fd7ed479512e3cf78" +content-hash = "99a17b17295f7c6adcd0a1b98e38c4aca1d3070dc349fbb1c6305955ad363806" diff --git a/pyproject.toml b/pyproject.toml index 6ec3876..df2a10e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,13 +43,14 @@ ipykernel = "*" pytest = "*" pytest-cov = "*" pytest-xdist = "*" +pytest-profiling = "*" pytest_notebook = "*" flake8 = "*" mypy = "*" black = "*" ipympl = "*" pyupgrade = "*" -ruff = "^0.1.4" +ruff = "*" [tool.pytest.ini_options] minversion = "6.0"