From be813ca9c67660c346674d8281f0c35c8053d49a Mon Sep 17 00:00:00 2001 From: Gianluca Rossi Date: Sat, 23 Mar 2024 16:30:05 -0400 Subject: [PATCH] chore: add pytest-cov to monitor test coverage --- makefile | 3 +++ pyproject.toml | 33 +++++++++++++++++---------------- requirements.txt | 5 +++++ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/makefile b/makefile index 168df15..7859537 100644 --- a/makefile +++ b/makefile @@ -13,5 +13,8 @@ mypy: test: pytest +coverage: + pytest --cov=blazingai tests + static-checks: mypy . --ignore-missing-imports --exclude build/ diff --git a/pyproject.toml b/pyproject.toml index aedcfa2..d673066 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,34 +7,35 @@ authors = [{name= "Gianluca Rossi" , email= "gr.gianlucarossi@gmail.com" }] license = {file = "LICENSE"} readme = "README.md" dependencies = [ - "scipy>1.9.3", - "loguru>0.6.0", - "omegaconf>2.2.3", - "scikit-learn>1.1.3", - "timm>0.6.11", - "torchmetrics>0.10.3", - "tqdm>4.64.1", - "transformers>4.24.0", - "pandas>1.5.1", + "scipy>=1.9.3", + "loguru>=0.6.0", + "omegaconf>=2.2.3", + "scikit-learn>=1.1.3", + "timm>=0.6.11", + "torchmetrics>=0.10.3", + "tqdm>=4.64.1", + "transformers>=4.24.0", + "pandas>=1.5.1", "lightning>=2.2.0", "torch", "numpy", - "datasets>2.7.1", - "sentencepiece>0.1.97", + "datasets>=2.7.1", + "sentencepiece>=0.1.97", ] [project.optional-dependencies] dev = [ "ruff", "pytest", + "pytest-cov", "ipdb", "mypy", "usort", - "pynvim", + "pynvim", # required for nvim lsp ] medical = [ - "pydicom>2.3.1", - "pylibjpeg>1.4.0", - "pylibjpeg-libjpeg>1.3.2", - "pylibjpeg-openjpeg>1.2.1", + "pydicom>=2.3.1", + "pylibjpeg>=1.4.0", + "pylibjpeg-libjpeg>=1.3.2", + "pylibjpeg-openjpeg>=1.2.1", ] diff --git a/requirements.txt b/requirements.txt index cbec47f..310f86a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,6 +24,8 @@ click==8.1.7 # via # moreorless # usort +coverage==7.4.4 + # via pytest-cov datasets==2.18.0 decorator==5.1.1 # via @@ -199,6 +201,8 @@ pylibjpeg-libjpeg==2.0.2 pylibjpeg-openjpeg==2.1.1 pynvim==0.5.0 pytest==8.1.1 + # via pytest-cov +pytest-cov==4.1.0 python-dateutil==2.9.0.post0 # via pandas pytorch-lightning==2.2.1 @@ -252,6 +256,7 @@ toml==0.10.2 # via usort tomli==2.0.1 # via + # coverage # ipdb # mypy # pytest