Skip to content

Commit ab38dd8

Browse files
authored
Remove types-click from Nox session for mypy (#952)
* Remove types-click from Nox session for mypy click >= 8.0 ships with py.typed, so types-click is not required. Installing types-click with click >= 8.0 leads to a mypy error: - python/typeshed#5642 * Remove unused `type: ignore` on `@click.version_option`
1 parent 0a37f41 commit ab38dd8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def mypy(session: Session) -> None:
119119
"""Type-check using mypy."""
120120
args = session.posargs or ["src", "tests", "docs/conf.py"]
121121
session.install(".")
122-
session.install("mypy", "pytest", "types-click")
122+
session.install("mypy", "pytest")
123123
session.run("mypy", *args)
124124
if not session.posargs:
125125
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")

{{cookiecutter.project_name}}/src/{{cookiecutter.package_name}}/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
import click
33

44

5-
# @click.version_option results in "untyped decorator" error
6-
# https://github.com/python/typeshed/issues/5642
7-
8-
95
@click.command()
10-
@click.version_option() # type: ignore[misc]
6+
@click.version_option()
117
def main() -> None:
128
"""{{cookiecutter.friendly_name}}."""
139

0 commit comments

Comments
 (0)