Skip to content

Commit 4d7053f

Browse files
committed
Enable type-checking
1 parent 984efea commit 4d7053f

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
include:
3535
- python-version: '3.7'
3636
toxenv: lint
37+
- python-version: '3.7'
38+
toxenv: typing
3739
steps:
3840
- name: Check out repository
3941
uses: actions/checkout@v4

setup.cfg

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,36 @@ classifiers =
3434
Environment :: Console
3535
Intended Audience :: Developers
3636
Topic :: System :: Logging
37+
Typing :: Typed
3738

3839
project_urls =
3940
Source Code = https://github.com/jwodder/click-loglevel
4041
Bug Tracker = https://github.com/jwodder/click-loglevel/issues
4142

4243
[options]
43-
py_modules = click_loglevel
44+
packages = find_namespace:
4445
package_dir =
4546
=src
4647
include_package_data = True
4748
python_requires = >=3.7
4849
install_requires =
4950
click >= 8.0
51+
52+
[options.packages.find]
53+
where = src
54+
55+
[mypy]
56+
allow_incomplete_defs = False
57+
allow_untyped_defs = False
58+
ignore_missing_imports = True
59+
# <https://github.com/python/mypy/issues/7773>:
60+
no_implicit_optional = True
61+
implicit_reexport = False
62+
local_partial_types = True
63+
pretty = True
64+
show_error_codes = True
65+
show_traceback = True
66+
strict_equality = True
67+
warn_redundant_casts = True
68+
warn_return_any = True
69+
warn_unreachable = True
File renamed without changes.

src/click_loglevel/py.typed

Whitespace-only changes.

tox.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = lint,py{36,37,38,39,310,311,312,py3}-click8
2+
envlist = lint,typing,py{36,37,38,39,310,311,312,py3}-click8
33
skip_missing_interpreters = True
44
isolated_build = True
55
minversion = 3.3.0
@@ -22,6 +22,13 @@ deps =
2222
commands =
2323
flake8 src test
2424

25+
[testenv:typing]
26+
deps =
27+
mypy
28+
{[testenv]deps}
29+
commands =
30+
mypy src test
31+
2532
[pytest]
2633
addopts = --cov=click_loglevel --no-cov-on-fail
2734
filterwarnings = error

0 commit comments

Comments
 (0)