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/.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/.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/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 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/pyproject.toml b/pyproject.toml index d90078d..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", ] @@ -67,7 +65,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..8666810 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", @@ -10,15 +10,16 @@ setup( license="3 Clause BSD", packages=find_packages(), include_package_data=True, + python_requires=">=3.9", install_requires=[ - "ruamel.yaml==0.17.*", + "ruamel.yaml==0.18.*", "jinja2", "pluggy==1.*", "backoff", "filelock", "requests", "bcrypt", - "jupyterhub-traefik-proxy==1.*", + "jupyterhub-traefik-proxy==2.*", ], entry_points={ "console_scripts": [ 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") 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