Merge pull request #998 from consideRatio/pr/bump-drop

Drop ubuntu 20.04, require py39, traefik-proxy v2, and ldapauthenticator v2
This commit is contained in:
Erik Sundell
2024-09-26 13:25:45 +02:00
committed by GitHub
10 changed files with 36 additions and 38 deletions

View File

@@ -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:

View File

@@ -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: ""

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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 = [

View File

@@ -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<major>\d+)
\.

View File

@@ -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": [

View File

@@ -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")

View File

@@ -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