Skip to content

Commit e7072ff

Browse files
authored
Clean up lint (#45)
1 parent d92ea61 commit e7072ff

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

pyproject.toml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ server = [
5252
test = [
5353
"pytest-timeout"
5454
]
55-
lint = [
56-
"black[jupyter]==22.12.0",
57-
"mdformat>0.7",
58-
"ruff==0.0.194",
59-
]
60-
typing = [
61-
"mypy>=0.990"
62-
]
6355

6456
[project.urls]
6557
Homepage = "http://jupyter.org"
@@ -96,13 +88,18 @@ test = "coverage run -m pytest {args}"
9688
nowarn = "test -W default {args}"
9789

9890
[tool.hatch.envs.typing]
99-
features = ["test", "typing", "server", "client"]
91+
features = ["test", "server", "client"]
10092
dependencies = ["mypy>=0.990"]
10193
[tool.hatch.envs.typing.scripts]
10294
test = "mypy --install-types --non-interactive {args:.}"
10395

10496
[tool.hatch.envs.lint]
105-
features = ["lint"]
97+
dependencies = [
98+
"black[jupyter]==22.12.0",
99+
"mdformat>0.7",
100+
"ruff==0.0.194",
101+
]
102+
detached = true
106103
[tool.hatch.envs.lint.scripts]
107104
style = [
108105
"ruff {args:.}",
@@ -168,7 +165,7 @@ target-version = ["py38"]
168165
target-version = "py38"
169166
line-length = 100
170167
select = [
171-
"A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T",
168+
"A", "B", "C", "E", "EM", "F", "FBT", "I", "N", "Q", "RUF", "S", "T",
172169
"UP", "W", "YTT",
173170
]
174171
ignore = [

pytest_jupyter/jupyter_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ def inner(nbpath):
372372
nbpath = jp_root_dir.joinpath(nbpath)
373373
# Check that the notebook has the correct file extension.
374374
if nbpath.suffix != ".ipynb":
375-
raise Exception("File extension for notebook must be .ipynb")
375+
msg = "File extension for notebook must be .ipynb"
376+
raise Exception(msg)
376377
# If the notebook path has a parent directory, make sure it's created.
377378
parent = nbpath.parent
378379
parent.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)