Skip to content

Commit 45e3262

Browse files
[pre-commit.ci] pre-commit autoupdate (#389)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.21.0 → 0.22.0](python-jsonschema/check-jsonschema@0.21.0...0.22.0) - [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0) - [github.com/charliermarsh/ruff-pre-commit: v0.0.254 → v0.0.260](astral-sh/ruff-pre-commit@v0.0.254...v0.0.260) * Lint code & align versions * Missed linter error --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Frédéric Collonval <[email protected]>
1 parent 5efaa1c commit 45e3262

File tree

8 files changed

+21
-15
lines changed

8 files changed

+21
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/python-jsonschema/check-jsonschema
22-
rev: 0.21.0
22+
rev: 0.22.0
2323
hooks:
2424
- id: check-github-workflows
2525

@@ -31,12 +31,12 @@ repos:
3131
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3232

3333
- repo: https://github.com/psf/black
34-
rev: 23.1.0
34+
rev: 23.3.0
3535
hooks:
3636
- id: black
3737

3838
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.254
39+
rev: v0.0.260
4040
hooks:
4141
- id: ruff
4242
args: ["--fix"]

jupyterlab_server/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def add_handlers(handlers, extension_app): # noqa
263263
allowed_extensions_uris = settings_config.get("allowed_extensions_uris", "")
264264

265265
if (blocked_extensions_uris) and (allowed_extensions_uris):
266-
warnings.warn(
266+
warnings.warn( # noqa B028
267267
"Simultaneous blocked_extensions_uris and allowed_extensions_uris is not supported. Please define only one of those."
268268
)
269269
import sys

jupyterlab_server/translations_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def get(self, locale=None):
5252
data, message = await current_loop.run_in_executor(
5353
None, partial(get_language_pack, locale)
5454
)
55-
if data == {} and message == "":
55+
if data == {} and not message:
5656
if is_valid_locale(locale):
5757
message = f"Language pack '{locale}' not installed!"
5858
else:

jupyterlab_server/workspaces_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _validate(self, data):
180180

181181
# If workspace_name is set in config, inject the
182182
# name into the workspace metadata.
183-
if self.workspace_name is not None and self.workspace_name != "":
183+
if self.workspace_name is not None and self.workspace_name:
184184
workspace["metadata"] = {"id": self.workspace_name}
185185
elif "id" not in workspace["metadata"]:
186186
msg = "The `id` field is missing in `metadata`."

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ test = "mypy --install-types --non-interactive {args:jupyterlab_server tests}"
116116

117117
[tool.hatch.envs.lint]
118118
dependencies = [
119-
"black[jupyter]==23.1.0",
119+
"black[jupyter]==23.3.0",
120120
"mdformat>0.7",
121121
"mdformat-gfm>=0.3.5",
122-
"ruff==0.0.254"
122+
"ruff==0.0.260"
123123
]
124124
detatched = true
125125
[tool.hatch.envs.lint.scripts]
@@ -249,8 +249,14 @@ ignore = [
249249
# F841 Local variable `list_data` is assigned to but never used
250250
# EM101 Exception must not use a string literal
251251
"tests/*" = ["S101", "A001", "F841", "EM101", "EM102", "EM103", "PLR2004"]
252+
# T201 `print` found
253+
"jupyterlab_server/licenses_app.py" = ["T201"]
254+
# T201 `print` found
255+
"jupyterlab_server/process.py" = ["T201"]
252256
# F401 `foo` imported but unused
253257
"jupyterlab_server/server.py" = ["F401"]
258+
# T201 `print` found
259+
"jupyterlab_server/workspaces_app.py" = ["B028", "T201"]
254260
# Invalid module name
255261
"tests/translations/jupyterlab-language-pack-es_CO/jupyterlab_language_pack_es_CO/__init__.py" = ["N999"]
256262

tests/test_labapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def test_page_config(labserverapp, jp_fetch):
5252
# Check that the lab template is loaded
5353
html = r.body.decode()
5454
page_config = extract_page_config(html)
55-
assert page_config['treePath'] == ""
55+
assert not page_config['treePath']
5656
assert page_config['preferredPath'] == "/"
5757

5858
def ispath(p):

tests/test_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ class TestApp(ProcessApp):
4646
# Kandle exception on older versions of server.
4747
except Exception as e:
4848
# Convert to warning so the test will pass on min version test.
49-
warnings.warn(str(e))
49+
warnings.warn(str(e)) # noqa B028

tests/test_translation_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,28 +143,28 @@ async def test_backend_locale_extension(jp_fetch):
143143
def test_get_installed_language_pack_locales_passes():
144144
data, message = _get_installed_language_pack_locales()
145145
assert "es_CO" in data
146-
assert message == ""
146+
assert not message
147147

148148

149149
def test_get_installed_package_locales():
150150
data, message = _get_installed_package_locales()
151151
assert "jupyterlab_some_package" in data
152152
assert os.path.isdir(data["jupyterlab_some_package"])
153-
assert message == ""
153+
assert not message
154154

155155

156156
def test_get_installed_packages_locale():
157157
data, message = get_installed_packages_locale("es_CO")
158158
assert "jupyterlab_some_package" in data
159159
assert "" in data["jupyterlab_some_package"]
160-
assert message == ""
160+
assert not message
161161

162162

163163
def test_get_language_packs():
164164
data, message = get_language_packs("en")
165165
assert "en" in data
166166
assert "es_CO" in data
167-
assert message == ""
167+
assert not message
168168

169169

170170
def test_get_language_pack():
@@ -173,7 +173,7 @@ def test_get_language_pack():
173173
assert "jupyterlab_some_package" in data
174174
assert "" in data["jupyterlab"]
175175
assert "" in data["jupyterlab_some_package"]
176-
assert message == ""
176+
assert not message
177177

178178

179179
# --- Utils

0 commit comments

Comments
 (0)