11[build-system ]
2- requires = [" hatchling>1.10" ]
2+ requires = [" hatchling>= 1.10" ]
33build-backend = " hatchling.build"
44
55[project ]
@@ -22,11 +22,11 @@ classifiers = [
2222 " License :: OSI Approved :: BSD License" ,
2323 " Programming Language :: Python" ,
2424 " Programming Language :: Python :: 3" ,
25- " Programming Language :: Python :: 3.6" ,
2625 " Programming Language :: Python :: 3.7" ,
2726 " Programming Language :: Python :: 3.8" ,
2827 " Programming Language :: Python :: 3.9" ,
2928 " Programming Language :: Python :: 3.10" ,
29+ " Programming Language :: Python :: 3.11" ,
3030]
3131dependencies = [
3232 " traitlets>=5.3" ,
@@ -36,6 +36,13 @@ dependencies = [
3636test = [
3737 " pytest" ,
3838]
39+ lint = [
40+ " black>=22.6.0" ,
41+ " mdformat>0.7" ,
42+ " mdformat-gfm>=0.3.5" ,
43+ " ruff>=0.0.156"
44+ ]
45+ typing = [" mypy>=0.990" ]
3946
4047[project .urls ]
4148Homepage = " https://github.com/ipython/comm"
@@ -48,6 +55,74 @@ include = [
4855 " /comm" ,
4956]
5057
58+ [tool .hatch .envs .test ]
59+ features = [" test" ]
60+ [tool .hatch .envs .test .scripts ]
61+ test = " python -m pytest -vv {args}"
62+ nowarn = " test -W default {args}"
63+
64+ [tool .hatch .envs .typing ]
65+ features = [" typing" , " test" ]
66+ [tool .hatch .envs .typing .scripts ]
67+ test = " mypy --install-types --non-interactive {args:comm tests}"
68+
69+ [tool .hatch .envs .lint ]
70+ features = [" lint" ]
71+ [tool .hatch .envs .lint .scripts ]
72+ style = [
73+ " ruff {args:.}" ,
74+ " black --check --diff {args:.}" ,
75+ " mdformat --check {args:*.md}"
76+ ]
77+ fmt = [
78+ " black {args:.}" ,
79+ " ruff --fix {args:.}" ,
80+ " mdformat {args:*.md}"
81+ ]
82+
5183[tool .pytest .ini_options ]
5284addopts = " -raXs --durations 10 --color=yes"
5385filterwarnings = [" error" ]
86+
87+ [tool .mypy ]
88+ check_untyped_defs = true
89+ disallow_incomplete_defs = true
90+ disallow_untyped_decorators = true
91+ no_implicit_optional = true
92+ no_implicit_reexport = true
93+ pretty = true
94+ show_error_context = true
95+ show_error_codes = true
96+ strict_equality = true
97+ strict_optional = true
98+ warn_unused_configs = true
99+ warn_redundant_casts = true
100+ warn_return_any = true
101+ warn_unused_ignores = true
102+
103+ [tool .black ]
104+ line-length = 100
105+ skip-string-normalization = true
106+ target-version = [" py37" ]
107+
108+ [tool .ruff ]
109+ target-version = " py37"
110+ line-length = 100
111+ select = [
112+ " A" , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
113+ " UP" , " W" , " YTT" ,
114+ ]
115+ ignore = [
116+ # FBT002 Boolean default value in function definition
117+ " FBT002" , " FBT003" ,
118+ ]
119+ unfixable = [
120+ # Don't touch print statements
121+ " T201" ,
122+ # Don't touch noqa lines
123+ " RUF100" ,
124+ ]
125+
126+ [tool .ruff .per-file-ignores ]
127+ # S101 Use of `assert` detected
128+ "tests/*" = [" S101" ]
0 commit comments