Skip to content

Commit 72dc363

Browse files
authored
Add mypy dependency to pyproject.toml if selected (#129)
2 parents 576a2ef + eaa46e5 commit 72dc363

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

template/pyproject.toml.jinja

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ requires-python = ">=3.7"
2323
[project.optional-dependencies]
2424
dev = [
2525
"copier",
26-
{% if sphinx %}"myst-parser",
26+
{% if type_checker=="mypy" %}"mypy",
27+
{% endif %}{% if sphinx %}"myst-parser",
2728
{% endif %}"pipdeptree",
2829
"pre-commit",
2930
{% if sphinx %}"pydata-sphinx-theme>=0.12",
30-
{% endif %}"pyright",
31-
"pytest",
31+
{% endif %}{% if type_checker=="pyright" %}"pyright",
32+
{% endif %}"pytest",
3233
"pytest-cov",
3334
"ruff",
3435
{% if sphinx %}"sphinx-autobuild",

tests/test_example.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def test_template(tmp_path: Path):
5555
run("./venv/bin/twine check --strict dist/*")
5656

5757

58+
def test_template_mypy(tmp_path: Path):
59+
copy_project(tmp_path, type_checker="mypy")
60+
run = make_venv(tmp_path)
61+
run("./venv/bin/tox -p")
62+
63+
5864
def test_template_no_docs(tmp_path: Path):
5965
copy_project(tmp_path, docs_type="README")
6066
run = make_venv(tmp_path)

0 commit comments

Comments
 (0)