From 8ba6167dd1c4d7f52e1fdadb637354219b6bbe9c Mon Sep 17 00:00:00 2001 From: Davide Sarra Date: Sat, 5 Nov 2022 14:53:24 +0000 Subject: [PATCH] Define test and lint requirements as extras --- .github/workflows/ci.yml | 2 +- makefile | 2 +- requirements/lint.txt | 2 -- requirements/test.txt | 3 --- setup.cfg | 9 +++++++++ tox.ini | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 requirements/lint.txt delete mode 100644 requirements/test.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fa333d..fb3ad71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -r requirements/lint.txt + python -m pip install .[lint] - name: Check order of Python imports run: isort --check-only --diff --quiet . - name: Check formatting of Python files diff --git a/makefile b/makefile index d7b8311..b07016e 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ SHELL := /usr/bin/env bash install: @ pip install --upgrade build pip setuptools twine && \ - pip install -e . -r requirements/lint.txt -r requirements/test.txt + pip install -e .[lint,test] build: install @ python -m build diff --git a/requirements/lint.txt b/requirements/lint.txt deleted file mode 100644 index 64cfb1d..0000000 --- a/requirements/lint.txt +++ /dev/null @@ -1,2 +0,0 @@ -black==22.10.0 -isort==5.10.1 diff --git a/requirements/test.txt b/requirements/test.txt deleted file mode 100644 index 81b7fa4..0000000 --- a/requirements/test.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=7.0.1 -pytest-cov==4.0.0 -tox==3.27.0 diff --git a/setup.cfg b/setup.cfg index b934295..daa2d12 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,3 +35,12 @@ packages = jupyter_spaces python_requires = ~=3.6 install_requires = ipython>=5.0.0 + +[options.extras_require] +lint = + black==22.10.0 + isort==5.10.1 +test = + pytest>=7.0.1 + pytest-cov==4.0.0 + tox==3.27.0 diff --git a/tox.ini b/tox.ini index cb8bc2a..6bcdbab 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ python = [testenv] deps = - -rrequirements/test.txt + -e.[test] ipython5: ipython>=5.0.0,<6.0.0 ipython6: ipython>=6.0.0,<7.0.0 ipython7: ipython>=7.3.0,<8.0.0