From 20072de48f881ab5a1b429bb6c7cce415bbac164 Mon Sep 17 00:00:00 2001 From: Gianluca Rossi Date: Sun, 24 Mar 2024 18:56:45 -0400 Subject: [PATCH] chore: create helper make command to rebuild project --- makefile | 10 +++++++++- pyproject.toml | 11 +++++++++++ requirements.txt | 38 ++++++++++++------------------------ tests/test_convert_images.py | 1 + 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/makefile b/makefile index 7859537..cf2a9f1 100644 --- a/makefile +++ b/makefile @@ -4,6 +4,14 @@ format: lint: ruff check --fix +rebuild: compile sync install + +compile: + uv pip compile --all-extras pyproject.toml -o requirements.txt + +sync: + uv pip sync requirements.txt + install: uv pip install -e ".[dev,medical]" @@ -14,7 +22,7 @@ test: pytest coverage: - pytest --cov=blazingai tests + pytest --cov=blazingai static-checks: mypy . --ignore-missing-imports --exclude build/ diff --git a/pyproject.toml b/pyproject.toml index 871dacb..7ecf4c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,3 +39,14 @@ medical = [ "pylibjpeg-libjpeg>=1.3.2", "pylibjpeg-openjpeg>=1.2.1", ] + +[tool.pytest.ini_options] +testpaths = ["tests"] +norecursedirs = [ + "*.egg-info", + ".*", + "blazingai", + "build", + "dist", +] +markers = ["slow"] diff --git a/requirements.txt b/requirements.txt index 310f86a..715feab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,8 +10,6 @@ antlr4-python3-runtime==4.9.3 # via omegaconf asttokens==2.4.1 # via stack-data -async-timeout==4.0.3 - # via aiohttp attrs==23.2.0 # via # aiohttp @@ -35,10 +33,6 @@ dill==0.3.8 # via # datasets # multiprocess -exceptiongroup==1.2.0 - # via - # ipython - # pytest executing==2.0.1 # via stack-data filelock==3.13.1 @@ -85,7 +79,7 @@ joblib==1.3.2 libcst==1.2.0 # via usort lightning==2.2.1 -lightning-utilities==0.10.1 +lightning-utilities==0.11.0 # via # lightning # pytorch-lightning @@ -112,9 +106,9 @@ mypy-extensions==1.0.0 # via # mypy # typing-inspect -networkx==3.1 +networkx==3.2.1 # via torch -numpy==1.24.4 +numpy==1.26.4 # via # datasets # lightning @@ -171,7 +165,7 @@ packaging==24.0 # pytorch-lightning # torchmetrics # transformers -pandas==2.0.3 +pandas==2.2.1 # via datasets parso==0.8.3 # via jedi @@ -189,7 +183,7 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -pyarrow==15.0.1 +pyarrow==15.0.2 # via datasets pyarrow-hotfix==0.6 # via datasets @@ -198,11 +192,11 @@ pygments==2.17.2 # via ipython pylibjpeg==2.0.0 pylibjpeg-libjpeg==2.0.2 -pylibjpeg-openjpeg==2.1.1 +pylibjpeg-openjpeg==2.2.0 pynvim==0.5.0 pytest==8.1.1 # via pytest-cov -pytest-cov==4.1.0 +pytest-cov==5.0.0 python-dateutil==2.9.0.post0 # via pandas pytorch-lightning==2.2.1 @@ -226,13 +220,13 @@ requests==2.31.0 # datasets # huggingface-hub # transformers -ruff==0.3.3 +ruff==0.3.4 safetensors==0.4.2 # via # timm # transformers -scikit-learn==1.3.2 -scipy==1.10.1 +scikit-learn==1.4.1.post1 +scipy==1.12.0 # via scikit-learn sentencepiece==0.2.0 setuptools==69.2.0 @@ -247,19 +241,13 @@ stdlibs==2024.1.28 # via usort sympy==1.12 # via torch -threadpoolctl==3.3.0 +threadpoolctl==3.4.0 # via scikit-learn timm==0.9.16 tokenizers==0.15.2 # via transformers toml==0.10.2 # via usort -tomli==2.0.1 - # via - # coverage - # ipdb - # mypy - # pytest torch==2.2.1 # via # lightning @@ -267,7 +255,7 @@ torch==2.2.1 # timm # torchmetrics # torchvision -torchmetrics==1.3.1 +torchmetrics==1.3.2 # via # lightning # pytorch-lightning @@ -286,7 +274,7 @@ traitlets==5.14.2 # via # ipython # matplotlib-inline -transformers==4.38.2 +transformers==4.39.1 triton==2.2.0 # via torch typing-extensions==4.10.0 diff --git a/tests/test_convert_images.py b/tests/test_convert_images.py index ff5bf48..af85be0 100644 --- a/tests/test_convert_images.py +++ b/tests/test_convert_images.py @@ -15,6 +15,7 @@ def dicom_file(tmpdir_factory): return Path(fpath) +@pytest.mark.slow def test_happy_case(dicom_file, tmp_path): # given assert dicom_file.exists()