diff --git a/pyproject.toml b/pyproject.toml index af3a75bf0..c40e9ab57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,10 +55,30 @@ dependencies = [ # Transitive dependencies that we need to limit for some reason "kiwisolver!=1.4.5", # matplotlib dep, 1.4.5 does not work when lazy-importing matplotlib ] -# (1) Optional dependencies are made dynamic so that we can reuse them in tox. The goal is to have each -# dependency and its version constraints specified only once to avoid inconsistencies. -dynamic = ["optional-dependencies"] +[project.optional-dependencies] +docs = [ + # Sphinx 7.2 dropped support for Python 3.8 + "Sphinx>=7.1", + "sphinx-click>=5.0", +] +lint = [ + "black>=22.1.0", + "pylint>=2.17", +] +test = [ + "pytest>=7.4", + "pytest-cov>=4.1", + "tox>=4.9.0", +] +typing = [ + "mypy>=1.5", + "mypy-extensions>=1.0", + "typing-extensions>=4.7", + "types-tabulate>=0.9", + "pandas-stubs>=2.0", + "nptyping>=2.5.0", +] [project.urls] Repository = "https://github.com/tfiedor/perun.git" diff --git a/requirements_docs.txt b/requirements_docs.txt deleted file mode 100644 index 46277ec70..000000000 --- a/requirements_docs.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Sphinx 7.2 dropped support for Python 3.8 -Sphinx>=7.1 -sphinx-click>= 5.0 \ No newline at end of file diff --git a/requirements_lint.txt b/requirements_lint.txt deleted file mode 100644 index 500880d71..000000000 --- a/requirements_lint.txt +++ /dev/null @@ -1,2 +0,0 @@ -pylint>=2.17 -black>=22.1.0 diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100644 index 390b04da4..000000000 --- a/requirements_test.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=7.4 -pytest-cov>=4.1 -tox>=4.9.0 \ No newline at end of file diff --git a/requirements_typing.txt b/requirements_typing.txt deleted file mode 100644 index d5ffed461..000000000 --- a/requirements_typing.txt +++ /dev/null @@ -1,7 +0,0 @@ -mypy>=1.5 -mypy-extensions>=1.0 -typing-extensions>=4.7 -types-tabulate>=0.9 -types-setuptools>=68.1.0.0 -pandas-stubs>=2.0 -nptyping>=2.5.0 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 09f9ae5a9..146b581dc 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,7 @@ commands = [testenv:lint] description = Run code style checker Pylint -skip_install = True -deps = -r requirements_lint.txt +extras = lint commands = pylint {posargs:perun} @@ -25,14 +24,14 @@ commands = # We can't skip install as some of our dependencies ship type hints directly in their core package # and not as a standalone typeshed package. description = Run static type checker Mypy -deps = -r requirements_typing.txt +extras = typing commands = mypy {posargs:./perun} [testenv:docs] description = Generate Sphinx HTML documentation allowlist_externals = make -deps = -r requirements_docs.txt +extras = docs commands = make docs [pytest]