@@ -36,7 +36,7 @@ Homepage = "https://jupyter.org"
3636[project .optional-dependencies ]
3737test = [
3838 " coverage" ,
39- " jupyter_server>=2.0.0rc8 " ,
39+ " jupyter_server>=2.0.0 " ,
4040 " pytest-jupyter[server]>=0.5.3" ,
4141 " pytest>=7.0" ,
4242 " pytest-cov" ,
@@ -55,14 +55,20 @@ docs = [
5555" sphinxcontrib_github_alt" ,
5656" sphinxemoji" ,
5757]
58+ lint = [
59+ " black[jupyter]>=22.6.0" ,
60+ " mdformat>0.7" ,
61+ " mdformat-gfm>=0.3.5" ,
62+ " ruff>=0.0.156"
63+ ]
64+ typing = [" mypy>=0.990" ]
5865
5966[tool .hatch .version ]
6067path = " jupyter_server_terminals/_version.py"
6168
6269[tool .hatch .build .targets .wheel .shared-data ]
6370"jupyter-config" = " etc/jupyter/jupyter_server_config.d"
6471
65-
6672[tool .hatch .envs .docs ]
6773features = [" docs" ]
6874[tool .hatch .envs .docs .scripts ]
@@ -81,6 +87,25 @@ dependencies = ["coverage", "pytest-cov"]
8187test = " python -m pytest -vv --cov jupyter_server_terminals --cov-branch --cov-report term-missing:skip-covered {args}"
8288nowarn = " test -W default {args}"
8389
90+ [tool .hatch .envs .typing ]
91+ features = [" typing" , " test" ]
92+ [tool .hatch .envs .typing .scripts ]
93+ test = " mypy --install-types --non-interactive {args:jupyter_server_terminals tests}"
94+
95+ [tool .hatch .envs .lint ]
96+ features = [" lint" ]
97+ [tool .hatch .envs .lint .scripts ]
98+ style = [
99+ " ruff {args:.}" ,
100+ " black --check --diff {args:.}" ,
101+ " mdformat --check {args:docs *.md}"
102+ ]
103+ fmt = [
104+ " black {args:.}" ,
105+ " ruff --fix {args:.}" ,
106+ " mdformat {args:docs *.md}"
107+ ]
108+
84109[tool .pytest .ini_options ]
85110addopts = " -raXs --durations 10 --color=yes --doctest-modules"
86111testpaths = [
@@ -114,23 +139,56 @@ warn_redundant_casts = true
114139warn_return_any = true
115140warn_unused_ignores = true
116141
117- [tool .flake8 ]
118- ignore = " E501, W503, E402"
119- builtins = " c, get_config"
120- exclude = [
121- " .cache" ,
122- " .github" ,
123- " docs" ,
124- " setup.py" ,
142+ [tool .black ]
143+ line-length = 100
144+ skip-string-normalization = true
145+ target-version = [" py37" ]
146+
147+ [tool .ruff ]
148+ target-version = " py37"
149+ line-length = 100
150+ select = [
151+ " A" , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
152+ " UP" , " W" , " YTT" ,
125153]
126- enable-extensions = " G"
127- extend-ignore = [
128- " G001" , " G002" , " G004" , " G200" , " G201" , " G202" ,
129- # black adds spaces around ':'
130- " E203" ,
154+ ignore = [
155+ # Allow non-abstract empty methods in abstract base classes
156+ " B027" ,
157+ # Ignore McCabe complexity
158+ " C901" ,
159+ # Allow boolean positional values in function calls, like `dict.get(... True)`
160+ " FBT003" ,
161+ # Use of `assert` detected
162+ " S101" ,
163+ # Line too long
164+ " E501" ,
165+ # Relative imports are banned
166+ " I252" ,
167+ # Boolean ... in function definition
168+ " FBT001" , " FBT002" ,
169+ # Module level import not at top of file
170+ " E402" ,
171+ # A001/A002/A003 .. is shadowing a python builtin
172+ " A001" , " A002" , " A003" ,
173+ # Possible hardcoded password
174+ " S105" , " S106" ,
175+ # Q000 Single quotes found but double quotes preferred
176+ " Q000" ,
177+ # N806 Variable `B` in function should be lowercase
178+ " N806" ,
179+ # T201 `print` found
180+ " T201" ,
181+ # N802 Function name `CreateWellKnownSid` should be lowercase
182+ " N802" , " N803"
131183]
132- per-file-ignores = [
133- # B011: Do not call assert False since python -O removes these calls
134- # F841 local variable 'foo' is assigned to but never used
135- " tests/*: B011" , " F841" ,
184+ unfixable = [
185+ # Don't touch print statements
186+ " T201" ,
187+ # Don't touch noqa lines
188+ " RUF100" ,
136189]
190+
191+ [tool .ruff .per-file-ignores ]
192+ # B011: Do not call assert False since python -O removes these calls
193+ # F841 local variable 'foo' is assigned to but never used
194+ "tests/*" = [" B011" , " F841" ]
0 commit comments