From 05948837e8ffcdc640766252ae8bcb78c355dc38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:57:31 +0000 Subject: [PATCH 1/2] Bump black[jupyter] from 23.9.1 to 24.2.0 Bumps [black[jupyter]](https://github.com/psf/black) from 23.9.1 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.9.1...24.2.0) --- updated-dependencies: - dependency-name: black[jupyter] dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47b497ba..bbf49d7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: [mdformat-gfm, mdformat-frontmatter, mdformat-footnote] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.2.0 hooks: - id: black diff --git a/pyproject.toml b/pyproject.toml index f43d760d..4da7fef0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ test = [ "websocket-client" ] lint = [ - "black[jupyter]==23.9.1", + "black[jupyter]==24.2.0", "mdformat>0.7", "mdformat-gfm>=0.3.5", "ruff==0.2.2" From 736edfc12ff965905a40929f75c74fa7df207946 Mon Sep 17 00:00:00 2001 From: Luciano Resende Date: Mon, 19 Feb 2024 17:01:54 -0800 Subject: [PATCH 2/2] Applied new formatting changes --- enterprise_gateway/__init__.py | 1 + enterprise_gateway/base/handlers.py | 1 + enterprise_gateway/client/gateway_client.py | 1 + enterprise_gateway/mixins.py | 1 + enterprise_gateway/services/api/handlers.py | 1 + enterprise_gateway/services/kernels/handlers.py | 1 + enterprise_gateway/services/kernels/remotemanager.py | 1 + enterprise_gateway/services/kernelspecs/handlers.py | 1 + .../services/kernelspecs/kernelspec_cache.py | 1 + .../services/processproxies/conductor.py | 1 + .../services/processproxies/container.py | 1 + enterprise_gateway/services/processproxies/crd.py | 1 + .../services/processproxies/distributed.py | 1 + .../services/processproxies/docker_swarm.py | 1 + enterprise_gateway/services/processproxies/k8s.py | 1 + .../services/processproxies/processproxy.py | 11 +++++------ .../services/processproxies/spark_operator.py | 1 + enterprise_gateway/services/processproxies/yarn.py | 1 + .../services/sessions/kernelsessionmanager.py | 1 + .../services/sessions/sessionmanager.py | 1 + enterprise_gateway/tests/test_gatewayapp.py | 6 +++--- etc/docker/kernel-image-puller/image_fetcher.py | 1 + etc/docker/kernel-image-puller/kernel_image_puller.py | 1 + etc/kernel-launchers/R/scripts/server_listener.py | 1 + etc/kernel-launchers/docker/scripts/launch_docker.py | 1 + .../python/scripts/launch_ipykernel.py | 1 + 26 files changed, 32 insertions(+), 9 deletions(-) diff --git a/enterprise_gateway/__init__.py b/enterprise_gateway/__init__.py index 4a7bf2f3..3853fb09 100644 --- a/enterprise_gateway/__init__.py +++ b/enterprise_gateway/__init__.py @@ -1,4 +1,5 @@ """Lazy-loading entrypoint for the enterprise gateway package.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from ._version import __version__ # noqa diff --git a/enterprise_gateway/base/handlers.py b/enterprise_gateway/base/handlers.py index 5d855688..bda75cac 100644 --- a/enterprise_gateway/base/handlers.py +++ b/enterprise_gateway/base/handlers.py @@ -1,4 +1,5 @@ """Tornado handlers for the base of the API.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/client/gateway_client.py b/enterprise_gateway/client/gateway_client.py index 3f8ca000..b046c7f7 100644 --- a/enterprise_gateway/client/gateway_client.py +++ b/enterprise_gateway/client/gateway_client.py @@ -1,4 +1,5 @@ """An Enterprise Gateway client.""" + import logging import os import queue diff --git a/enterprise_gateway/mixins.py b/enterprise_gateway/mixins.py index 9d2e4ee1..6152a1b8 100644 --- a/enterprise_gateway/mixins.py +++ b/enterprise_gateway/mixins.py @@ -1,4 +1,5 @@ """Mixins for Tornado handlers.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/api/handlers.py b/enterprise_gateway/services/api/handlers.py index 99514728..ce069d50 100644 --- a/enterprise_gateway/services/api/handlers.py +++ b/enterprise_gateway/services/api/handlers.py @@ -1,4 +1,5 @@ """Tornado handlers for kernel specs.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/kernels/handlers.py b/enterprise_gateway/services/kernels/handlers.py index 54c18d6d..d5d2c590 100644 --- a/enterprise_gateway/services/kernels/handlers.py +++ b/enterprise_gateway/services/kernels/handlers.py @@ -1,4 +1,5 @@ """Tornado handlers for kernel CRUD and communication.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/kernels/remotemanager.py b/enterprise_gateway/services/kernels/remotemanager.py index b277b2d2..f906d68f 100644 --- a/enterprise_gateway/services/kernels/remotemanager.py +++ b/enterprise_gateway/services/kernels/remotemanager.py @@ -1,4 +1,5 @@ """Kernel managers that operate against a remote process.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/kernelspecs/handlers.py b/enterprise_gateway/services/kernelspecs/handlers.py index 72f23423..72519887 100644 --- a/enterprise_gateway/services/kernelspecs/handlers.py +++ b/enterprise_gateway/services/kernelspecs/handlers.py @@ -1,4 +1,5 @@ """Tornado handlers for kernel specs.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/kernelspecs/kernelspec_cache.py b/enterprise_gateway/services/kernelspecs/kernelspec_cache.py index 28234621..f387addc 100644 --- a/enterprise_gateway/services/kernelspecs/kernelspec_cache.py +++ b/enterprise_gateway/services/kernelspecs/kernelspec_cache.py @@ -1,4 +1,5 @@ """Cache handling for kernel specs.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/conductor.py b/enterprise_gateway/services/processproxies/conductor.py index 5a6e2e34..c4d13574 100644 --- a/enterprise_gateway/services/processproxies/conductor.py +++ b/enterprise_gateway/services/processproxies/conductor.py @@ -1,4 +1,5 @@ """Code related to managing kernels running in Conductor clusters.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/container.py b/enterprise_gateway/services/processproxies/container.py index feee9c63..6378b633 100644 --- a/enterprise_gateway/services/processproxies/container.py +++ b/enterprise_gateway/services/processproxies/container.py @@ -1,4 +1,5 @@ """Code related to managing kernels running in containers.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/crd.py b/enterprise_gateway/services/processproxies/crd.py index 7e47a5dc..54f24b5c 100644 --- a/enterprise_gateway/services/processproxies/crd.py +++ b/enterprise_gateway/services/processproxies/crd.py @@ -1,4 +1,5 @@ """Code related to managing kernels running based on k8s custom resource.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/distributed.py b/enterprise_gateway/services/processproxies/distributed.py index 164934a3..4dfa0ccd 100644 --- a/enterprise_gateway/services/processproxies/distributed.py +++ b/enterprise_gateway/services/processproxies/distributed.py @@ -1,4 +1,5 @@ """Code used for the generic distribution of kernels across a set of hosts.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/docker_swarm.py b/enterprise_gateway/services/processproxies/docker_swarm.py index f3b05aac..76d91b54 100644 --- a/enterprise_gateway/services/processproxies/docker_swarm.py +++ b/enterprise_gateway/services/processproxies/docker_swarm.py @@ -1,4 +1,5 @@ """Code related to managing kernels running in docker-based containers.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/k8s.py b/enterprise_gateway/services/processproxies/k8s.py index 5ca69a9b..00e6bf17 100644 --- a/enterprise_gateway/services/processproxies/k8s.py +++ b/enterprise_gateway/services/processproxies/k8s.py @@ -1,4 +1,5 @@ """Code related to managing kernels running in Kubernetes clusters.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/processproxies/processproxy.py b/enterprise_gateway/services/processproxies/processproxy.py index 177c4949..405adfbc 100644 --- a/enterprise_gateway/services/processproxies/processproxy.py +++ b/enterprise_gateway/services/processproxies/processproxy.py @@ -1,4 +1,5 @@ """Kernel managers that operate against a remote process.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations @@ -1332,9 +1333,9 @@ def _setup_connection_info(self, connect_info: dict) -> None: f"Host assigned to the kernel is: '{self.assigned_host}' '{self.assigned_ip}'" ) - connect_info[ - "ip" - ] = self.assigned_ip # Set connection to IP address of system where the kernel was launched + connect_info["ip"] = ( + self.assigned_ip + ) # Set connection to IP address of system where the kernel was launched if tunneling_enabled is True: # Capture the current(tunneled) connect_info relative to the IP and ports (including the @@ -1398,9 +1399,7 @@ def _update_connection(self, connect_info: dict) -> None: Note: Do NOT update connect_info with IP and other such artifacts in this method/function. """ # Reset the ports to 0 so load can take place (which resets the members to value from file or json)... - self.kernel_manager.stdin_port = ( - self.kernel_manager.iopub_port - ) = ( + self.kernel_manager.stdin_port = self.kernel_manager.iopub_port = ( self.kernel_manager.shell_port ) = self.kernel_manager.hb_port = self.kernel_manager.control_port = 0 diff --git a/enterprise_gateway/services/processproxies/spark_operator.py b/enterprise_gateway/services/processproxies/spark_operator.py index 13276340..cabf529e 100644 --- a/enterprise_gateway/services/processproxies/spark_operator.py +++ b/enterprise_gateway/services/processproxies/spark_operator.py @@ -1,4 +1,5 @@ """A spark operator process proxy.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations diff --git a/enterprise_gateway/services/processproxies/yarn.py b/enterprise_gateway/services/processproxies/yarn.py index 384e0391..58bef1d3 100644 --- a/enterprise_gateway/services/processproxies/yarn.py +++ b/enterprise_gateway/services/processproxies/yarn.py @@ -1,4 +1,5 @@ """Code related to managing kernels running in YARN clusters.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/sessions/kernelsessionmanager.py b/enterprise_gateway/services/sessions/kernelsessionmanager.py index 487b3571..f4e73ca9 100644 --- a/enterprise_gateway/services/sessions/kernelsessionmanager.py +++ b/enterprise_gateway/services/sessions/kernelsessionmanager.py @@ -1,4 +1,5 @@ """Session manager that keeps all its metadata in memory.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/services/sessions/sessionmanager.py b/enterprise_gateway/services/sessions/sessionmanager.py index 4ca5aa0d..4b3da0ed 100644 --- a/enterprise_gateway/services/sessions/sessionmanager.py +++ b/enterprise_gateway/services/sessions/sessionmanager.py @@ -1,4 +1,5 @@ """Session manager that keeps all its metadata in memory.""" + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/enterprise_gateway/tests/test_gatewayapp.py b/enterprise_gateway/tests/test_gatewayapp.py index b4490f31..8e0f59cf 100644 --- a/enterprise_gateway/tests/test_gatewayapp.py +++ b/enterprise_gateway/tests/test_gatewayapp.py @@ -96,9 +96,9 @@ def test_config_env_vars(self): os.environ["EG_CERTFILE"] = "/test/fake.crt" os.environ["EG_CLIENT_CA"] = "/test/fake_ca.crt" os.environ["EG_SSL_VERSION"] = "3" - os.environ[ - "EG_KERNEL_SESSION_PERSISTENCE" - ] = "True" # availability mode will be defaulted to replication + os.environ["EG_KERNEL_SESSION_PERSISTENCE"] = ( + "True" # availability mode will be defaulted to replication + ) self._assert_envs_to_traitlets("EG_") diff --git a/etc/docker/kernel-image-puller/image_fetcher.py b/etc/docker/kernel-image-puller/image_fetcher.py index d4500b3a..b18c990a 100644 --- a/etc/docker/kernel-image-puller/image_fetcher.py +++ b/etc/docker/kernel-image-puller/image_fetcher.py @@ -1,4 +1,5 @@ """image name fetcher abstract class and concrete implementation""" + import abc import importlib import os diff --git a/etc/docker/kernel-image-puller/kernel_image_puller.py b/etc/docker/kernel-image-puller/kernel_image_puller.py index c1196b94..67286c8e 100644 --- a/etc/docker/kernel-image-puller/kernel_image_puller.py +++ b/etc/docker/kernel-image-puller/kernel_image_puller.py @@ -1,4 +1,5 @@ """A kernel image puller.""" + import importlib import logging import os diff --git a/etc/kernel-launchers/R/scripts/server_listener.py b/etc/kernel-launchers/R/scripts/server_listener.py index 9fd57987..2ca755c6 100644 --- a/etc/kernel-launchers/R/scripts/server_listener.py +++ b/etc/kernel-launchers/R/scripts/server_listener.py @@ -1,4 +1,5 @@ """A server listener for R.""" + import base64 import json import logging diff --git a/etc/kernel-launchers/docker/scripts/launch_docker.py b/etc/kernel-launchers/docker/scripts/launch_docker.py index 1b3a8f1d..3217b99a 100644 --- a/etc/kernel-launchers/docker/scripts/launch_docker.py +++ b/etc/kernel-launchers/docker/scripts/launch_docker.py @@ -1,4 +1,5 @@ """Launches a containerized kernel.""" + import argparse import os import sys diff --git a/etc/kernel-launchers/python/scripts/launch_ipykernel.py b/etc/kernel-launchers/python/scripts/launch_ipykernel.py index 72f29751..4ed8b3b1 100644 --- a/etc/kernel-launchers/python/scripts/launch_ipykernel.py +++ b/etc/kernel-launchers/python/scripts/launch_ipykernel.py @@ -1,4 +1,5 @@ """Launch an ipython kernel.""" + import argparse import base64 import json