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/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", 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. 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"]