From 7639a9e4f742b1f436f02315157b42b0c40a6dbe Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 16 Dec 2023 06:27:55 -0600 Subject: [PATCH 1/3] use ruff docstring-code-format --- .pre-commit-config.yaml | 10 ++-------- pyproject.toml | 5 ++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fce7856ec..3f35ede468 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.2 + rev: 0.27.3 hooks: - id: check-github-workflows @@ -38,12 +38,6 @@ repos: - id: prettier types_or: [yaml, html, json] - - repo: https://github.com/adamchainz/blacken-docs - rev: "1.16.0" - hooks: - - id: blacken-docs - additional_dependencies: [black==23.7.0] - - repo: https://github.com/codespell-project/codespell rev: "v2.2.6" hooks: @@ -67,7 +61,7 @@ repos: ["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.8 hooks: - id: ruff types_or: [python, jupyter] diff --git a/pyproject.toml b/pyproject.toml index 1787b32168..aaf768627a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,6 +142,9 @@ optional-editable-build = true [tool.ruff] line-length = 100 +[tool.ruff.format] +docstring-code-format = true + [tool.ruff.lint] select = [ "B", # flake8-bugbear @@ -295,4 +298,4 @@ exclude = ["docs", "test"] ignore = ["W002"] [tool.repo-review] -ignore = ["GH102"] +ignore = ["GH102", "PC111"] From 23191b4f95bbc1e52a32d9158db8497a014527b2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 16 Dec 2023 06:36:00 -0600 Subject: [PATCH 2/3] fix example --- examples/simple/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/simple/pyproject.toml b/examples/simple/pyproject.toml index 694b7a4f50..38ae8e71a7 100644 --- a/examples/simple/pyproject.toml +++ b/examples/simple/pyproject.toml @@ -31,6 +31,9 @@ source = "nodejs" [tool.hatch.build.targets.wheel.shared-data] "etc/jupyter/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d" +[tool.hatch.build.targets.wheel] +packages = ["simple_ext1", "simple_ext2", "simple_ext11"] + [tool.hatch.build.hooks.jupyter-builder] dependencies = [ "hatch-jupyter-builder>=0.8.2", From 7a2b4208999aea1d8d6356950a3545b32f6d5e00 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 12:36:34 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jupyter_server/auth/security.py | 11 +++++------ jupyter_server/utils.py | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/jupyter_server/auth/security.py b/jupyter_server/auth/security.py index a5ae185f1e..ede64db522 100644 --- a/jupyter_server/auth/security.py +++ b/jupyter_server/auth/security.py @@ -41,7 +41,7 @@ def passwd(passphrase=None, algorithm="argon2"): Examples -------- - >>> passwd('mypassword') # doctest: +ELLIPSIS + >>> passwd("mypassword") # doctest: +ELLIPSIS 'argon2:...' """ @@ -93,15 +93,14 @@ def passwd_check(hashed_passphrase, passphrase): Examples -------- - >>> myhash = passwd('mypassword') - >>> passwd_check(myhash, 'mypassword') + >>> myhash = passwd("mypassword") + >>> passwd_check(myhash, "mypassword") True - >>> passwd_check(myhash, 'otherpassword') + >>> passwd_check(myhash, "otherpassword") False - >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a', - ... 'mypassword') + >>> passwd_check("sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a", "mypassword") True """ if hashed_passphrase.startswith("argon2:"): diff --git a/jupyter_server/utils.py b/jupyter_server/utils.py index 2a4c185d97..968d1fd27c 100644 --- a/jupyter_server/utils.py +++ b/jupyter_server/utils.py @@ -344,11 +344,11 @@ def filefind(filename: str, path_dirs: Sequence[str] | str | None = None) -> str path dirs is given, the filename is tested as is, after running through :func:`expandvars` and :func:`expanduser`. Thus a simple call:: - filefind('myfile.txt') + filefind("myfile.txt") will find the file in the current working dir, but:: - filefind('~/myfile.txt') + filefind("~/myfile.txt") Will find the file in the users home directory. This function does not automatically try any paths, such as the cwd or the user's home directory.