From 92465ade36cce37b764236072059c2f7d3995d93 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 22:03:06 +0200 Subject: [PATCH 1/7] Bump to 2.0.0.dev --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d90078d..9ebb7e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ omit = [ github_url = "https://github.com/jupyterhub/the-littlest-jupyterhub" [tool.tbump.version] -current = "1.0.1.dev" +current = "2.0.0.dev" regex = ''' (?P\d+) \. diff --git a/setup.py b/setup.py index 0bb5a1c..5caeab9 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup setup( name="the-littlest-jupyterhub", - version="1.0.1.dev", + version="2.0.0.dev", description="A small JupyterHub distribution", url="https://github.com/jupyterhub/the-littlest-jupyterhub", author="Jupyter Development Team", From 3f55ac29128c4d75bd1a4b342dae0fbafda53060 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 21:43:55 +0200 Subject: [PATCH 2/7] Drop support for ubuntu 20.04 and Python 3.8 --- .github/workflows/integration-test.yaml | 3 --- bootstrap/bootstrap.py | 20 ++++++++++---------- integration-tests/test_bootstrap.py | 4 ++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 226a1a0..cd98ad5 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -39,9 +39,6 @@ jobs: - name: "Debian 12, Py 3.11" distro_image: "debian:12" extra_flags: "" - - name: "Ubuntu 20.04, Py 3.8" - distro_image: "ubuntu:20.04" - extra_flags: "" - name: "Ubuntu 22.04 Py 3.10" distro_image: "ubuntu:22.04" extra_flags: "" diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index f69aceb..75072f4 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -9,10 +9,10 @@ This script is run as: Constraints: - - The entire script should be compatible with Python 3.8, which is the default on - Ubuntu 20.04. - - The script should parse in Python 3.6 as we print error messages for using - Ubuntu 18.04 which comes with Python 3.6 by default. + - The entire script should be compatible with Python 3.9, which is the default on + Debian 11. + - The script should parse in Python 3.8 as we print error messages for using + Ubuntu 20.04 which comes with Python 3.8 by default. - The script must depend only on stdlib modules, as no previous installation of dependencies can be assumed. @@ -210,22 +210,22 @@ def ensure_host_system_can_install_tljh(): Check if TLJH is installable in current host system and exit with a clear error message otherwise. """ - # Require Ubuntu 20.04+ or Debian 11+ + # Require Ubuntu 22.04+ or Debian 11+ distro = get_os_release_variable("ID") version = get_os_release_variable("VERSION_ID") if distro not in ["ubuntu", "debian"]: print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only") sys.exit(1) - elif distro == "ubuntu" and _parse_version(version) < (20, 4): - print("The Littlest JupyterHub requires Ubuntu 20.04 or higher") + elif distro == "ubuntu" and _parse_version(version) < (22, 4): + print("The Littlest JupyterHub requires Ubuntu 22.04 or higher") sys.exit(1) elif distro == "debian" and _parse_version(version) < (11,): print("The Littlest JupyterHub requires Debian 11 or higher") sys.exit(1) - # Require Python 3.8+ - if sys.version_info < (3, 8): - print(f"bootstrap.py must be run with at least Python 3.8, found {sys.version}") + # Require Python 3.9+ + if sys.version_info < (3, 9): + print(f"bootstrap.py must be run with at least Python 3.9, found {sys.version}") sys.exit(1) # Require systemd (systemctl is a part of systemd) diff --git a/integration-tests/test_bootstrap.py b/integration-tests/test_bootstrap.py index eac9c92..0846d63 100644 --- a/integration-tests/test_bootstrap.py +++ b/integration-tests/test_bootstrap.py @@ -85,9 +85,9 @@ def test_ubuntu_too_old(): """ Error with a useful message when running in older Ubuntu """ - output = _run_bootstrap_in_container("ubuntu:18.04", False) + output = _run_bootstrap_in_container("ubuntu:20.04", False) _stop_container() - assert output.stdout == "The Littlest JupyterHub requires Ubuntu 20.04 or higher\n" + assert output.stdout == "The Littlest JupyterHub requires Ubuntu 22.04 or higher\n" assert output.returncode == 1 From 1a9f3d65a4a0c8aec85dfa15a051710d75d0eccc Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 22:04:36 +0200 Subject: [PATCH 3/7] tljh package: bump to ruamel.yaml==0.18.* --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5caeab9..2b8af9c 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( packages=find_packages(), include_package_data=True, install_requires=[ - "ruamel.yaml==0.17.*", + "ruamel.yaml==0.18.*", "jinja2", "pluggy==1.*", "backoff", From 363dc45b524ebe14910207a4323a1052d9a4b5f5 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 22:05:26 +0200 Subject: [PATCH 4/7] tljh package: bump to traefik-proxy v2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2b8af9c..9298d93 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( "filelock", "requests", "bcrypt", - "jupyterhub-traefik-proxy==1.*", + "jupyterhub-traefik-proxy==2.*", ], entry_points={ "console_scripts": [ From 436c81f26d22487fb494d83795e5fb1779557877 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 22:06:53 +0200 Subject: [PATCH 5/7] tljh package: require python 3.9+ --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 4 +--- setup.py | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 688a10e..4b5f357 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,8 +15,8 @@ repos: hooks: - id: pyupgrade args: - - --py36-plus - # We need the bootstrap.py script to be parsable with Python 3.5, so we + - --py39-plus + # We need the bootstrap.py script to be parsable with Python 3.8, so we # exclude it from the pyupgrade hook that will apply f-strings etc. exclude: bootstrap/bootstrap.py diff --git a/pyproject.toml b/pyproject.toml index 9ebb7e0..db33483 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,12 +25,10 @@ profile = "black" # target-version should be all supported versions, see # https://github.com/psf/black/issues/751#issuecomment-473066811 target_version = [ - "py36", - "py37", - "py38", "py39", "py310", "py311", + "py312", ] diff --git a/setup.py b/setup.py index 9298d93..8666810 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ setup( license="3 Clause BSD", packages=find_packages(), include_package_data=True, + python_requires=">=3.9", install_requires=[ "ruamel.yaml==0.18.*", "jinja2", From 0de2db365adfb917ff4d971e4b59999ccb7de946 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 22:11:25 +0200 Subject: [PATCH 6/7] pre-commit: run hooks --- .github/integration-test.py | 2 +- integration-tests/test_extensions.py | 3 +-- tests/test_config.py | 15 +++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/integration-test.py b/.github/integration-test.py index 73ef8ba..0ceed6a 100755 --- a/.github/integration-test.py +++ b/.github/integration-test.py @@ -10,7 +10,7 @@ GIT_REPO_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) TEST_IMAGE_NAME = "test-systemd" -@functools.lru_cache() +@functools.lru_cache def _get_container_runtime_cli(): runtimes = ["docker", "podman"] for runtime in runtimes: diff --git a/integration-tests/test_extensions.py b/integration-tests/test_extensions.py index 661432b..0e4c2c8 100644 --- a/integration-tests/test_extensions.py +++ b/integration-tests/test_extensions.py @@ -29,8 +29,7 @@ def test_labextensions(): # jupyter-labextension writes to stdout and stderr weirdly proc = subprocess.run( ["/opt/tljh/user/bin/jupyter-labextension", "list"], - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, + capture_output=True, ) extensions = [ diff --git a/tests/test_config.py b/tests/test_config.py index 72cf65e..2d6ded4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -143,18 +143,21 @@ def test_remove_from_config_error(): def test_reload_hub(): - with mock.patch("tljh.systemd.restart_service") as restart_service, mock.patch( - "tljh.systemd.check_service_active" - ) as check_active, mock.patch("tljh.config.check_hub_ready") as check_ready: + with ( + mock.patch("tljh.systemd.restart_service") as restart_service, + mock.patch("tljh.systemd.check_service_active") as check_active, + mock.patch("tljh.config.check_hub_ready") as check_ready, + ): config.reload_component("hub") restart_service.assert_called_with("jupyterhub") check_active.assert_called_with("jupyterhub") def test_reload_proxy(tljh_dir): - with mock.patch("tljh.systemd.restart_service") as restart_service, mock.patch( - "tljh.systemd.check_service_active" - ) as check_active: + with ( + mock.patch("tljh.systemd.restart_service") as restart_service, + mock.patch("tljh.systemd.check_service_active") as check_active, + ): config.reload_component("proxy") restart_service.assert_called_with("traefik") check_active.assert_called_with("traefik") From e8602fc4a1950f967df249ba432e75ef6cdd3a2b Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 18 Sep 2024 11:20:34 +0200 Subject: [PATCH 7/7] Update lower bounds on dependencies for tljh 2 beta release --- tljh/requirements-hub-env.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tljh/requirements-hub-env.txt b/tljh/requirements-hub-env.txt index 0c45572..ee733f7 100644 --- a/tljh/requirements-hub-env.txt +++ b/tljh/requirements-hub-env.txt @@ -10,12 +10,12 @@ # jupyterhub>=5.1.0,<6 jupyterhub-systemdspawner>=1.0.1,<2 -jupyterhub-firstuseauthenticator>=1.0.0,<2 -jupyterhub-nativeauthenticator>=1.2.0,<2 -jupyterhub-ldapauthenticator>=1.3.2,<2 +jupyterhub-firstuseauthenticator>=1.1.0,<2 +jupyterhub-nativeauthenticator>=1.3.0,<2 +jupyterhub-ldapauthenticator==2.0.0b2 # FIXME: update to >=2.0.0,<3 jupyterhub-tmpauthenticator>=1.0.0,<2 oauthenticator>=17,<18 -jupyterhub-idle-culler>=1.2.1,<2 +jupyterhub-idle-culler>=1.4.0,<2 # pycurl is installed to improve reliability and performance for when JupyterHub # makes web requests. JupyterHub will use tornado's CurlAsyncHTTPClient when @@ -25,4 +25,4 @@ jupyterhub-idle-culler>=1.2.1,<2 # ref: https://www.tornadoweb.org/en/stable/httpclient.html#module-tornado.simple_httpclient # ref: https://github.com/jupyterhub/the-littlest-jupyterhub/issues/289 # -pycurl>=7.45.2,<8 +pycurl>=7.45.3,<8