Skip to content

Commit

Permalink
build: Make optional dependencies static
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryMichal committed Nov 27, 2023
1 parent cbc5f41 commit 76bef0e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
26 changes: 23 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions requirements_docs.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements_lint.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_test.txt

This file was deleted.

7 changes: 0 additions & 7 deletions requirements_typing.txt

This file was deleted.

7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ commands =

[testenv:lint]
description = Run code style checker Pylint
skip_install = True
deps = -r requirements_lint.txt
extras = lint
commands =
pylint {posargs:perun}

[testenv:typing]
# 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]
Expand Down

0 comments on commit 76bef0e

Please sign in to comment.