mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
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:
2
.github/integration-test.py
vendored
2
.github/integration-test.py
vendored
@@ -10,7 +10,7 @@ GIT_REPO_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|||||||
TEST_IMAGE_NAME = "test-systemd"
|
TEST_IMAGE_NAME = "test-systemd"
|
||||||
|
|
||||||
|
|
||||||
@functools.lru_cache()
|
@functools.lru_cache
|
||||||
def _get_container_runtime_cli():
|
def _get_container_runtime_cli():
|
||||||
runtimes = ["docker", "podman"]
|
runtimes = ["docker", "podman"]
|
||||||
for runtime in runtimes:
|
for runtime in runtimes:
|
||||||
|
|||||||
3
.github/workflows/integration-test.yaml
vendored
3
.github/workflows/integration-test.yaml
vendored
@@ -39,9 +39,6 @@ jobs:
|
|||||||
- name: "Debian 12, Py 3.11"
|
- name: "Debian 12, Py 3.11"
|
||||||
distro_image: "debian:12"
|
distro_image: "debian:12"
|
||||||
extra_flags: ""
|
extra_flags: ""
|
||||||
- name: "Ubuntu 20.04, Py 3.8"
|
|
||||||
distro_image: "ubuntu:20.04"
|
|
||||||
extra_flags: ""
|
|
||||||
- name: "Ubuntu 22.04 Py 3.10"
|
- name: "Ubuntu 22.04 Py 3.10"
|
||||||
distro_image: "ubuntu:22.04"
|
distro_image: "ubuntu:22.04"
|
||||||
extra_flags: ""
|
extra_flags: ""
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args:
|
args:
|
||||||
- --py36-plus
|
- --py39-plus
|
||||||
# We need the bootstrap.py script to be parsable with Python 3.5, so we
|
# 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 it from the pyupgrade hook that will apply f-strings etc.
|
||||||
exclude: bootstrap/bootstrap.py
|
exclude: bootstrap/bootstrap.py
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ This script is run as:
|
|||||||
|
|
||||||
Constraints:
|
Constraints:
|
||||||
|
|
||||||
- The entire script should be compatible with Python 3.8, which is the default on
|
- The entire script should be compatible with Python 3.9, which is the default on
|
||||||
Ubuntu 20.04.
|
Debian 11.
|
||||||
- The script should parse in Python 3.6 as we print error messages for using
|
- The script should parse in Python 3.8 as we print error messages for using
|
||||||
Ubuntu 18.04 which comes with Python 3.6 by default.
|
Ubuntu 20.04 which comes with Python 3.8 by default.
|
||||||
- The script must depend only on stdlib modules, as no previous installation
|
- The script must depend only on stdlib modules, as no previous installation
|
||||||
of dependencies can be assumed.
|
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
|
Check if TLJH is installable in current host system and exit with a clear
|
||||||
error message otherwise.
|
error message otherwise.
|
||||||
"""
|
"""
|
||||||
# Require Ubuntu 20.04+ or Debian 11+
|
# Require Ubuntu 22.04+ or Debian 11+
|
||||||
distro = get_os_release_variable("ID")
|
distro = get_os_release_variable("ID")
|
||||||
version = get_os_release_variable("VERSION_ID")
|
version = get_os_release_variable("VERSION_ID")
|
||||||
if distro not in ["ubuntu", "debian"]:
|
if distro not in ["ubuntu", "debian"]:
|
||||||
print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only")
|
print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif distro == "ubuntu" and _parse_version(version) < (20, 4):
|
elif distro == "ubuntu" and _parse_version(version) < (22, 4):
|
||||||
print("The Littlest JupyterHub requires Ubuntu 20.04 or higher")
|
print("The Littlest JupyterHub requires Ubuntu 22.04 or higher")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif distro == "debian" and _parse_version(version) < (11,):
|
elif distro == "debian" and _parse_version(version) < (11,):
|
||||||
print("The Littlest JupyterHub requires Debian 11 or higher")
|
print("The Littlest JupyterHub requires Debian 11 or higher")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Require Python 3.8+
|
# Require Python 3.9+
|
||||||
if sys.version_info < (3, 8):
|
if sys.version_info < (3, 9):
|
||||||
print(f"bootstrap.py must be run with at least Python 3.8, found {sys.version}")
|
print(f"bootstrap.py must be run with at least Python 3.9, found {sys.version}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Require systemd (systemctl is a part of systemd)
|
# Require systemd (systemctl is a part of systemd)
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ def test_ubuntu_too_old():
|
|||||||
"""
|
"""
|
||||||
Error with a useful message when running in older Ubuntu
|
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()
|
_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
|
assert output.returncode == 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ def test_labextensions():
|
|||||||
# jupyter-labextension writes to stdout and stderr weirdly
|
# jupyter-labextension writes to stdout and stderr weirdly
|
||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
["/opt/tljh/user/bin/jupyter-labextension", "list"],
|
["/opt/tljh/user/bin/jupyter-labextension", "list"],
|
||||||
stderr=subprocess.PIPE,
|
capture_output=True,
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
|
|||||||
@@ -25,12 +25,10 @@ profile = "black"
|
|||||||
# target-version should be all supported versions, see
|
# target-version should be all supported versions, see
|
||||||
# https://github.com/psf/black/issues/751#issuecomment-473066811
|
# https://github.com/psf/black/issues/751#issuecomment-473066811
|
||||||
target_version = [
|
target_version = [
|
||||||
"py36",
|
|
||||||
"py37",
|
|
||||||
"py38",
|
|
||||||
"py39",
|
"py39",
|
||||||
"py310",
|
"py310",
|
||||||
"py311",
|
"py311",
|
||||||
|
"py312",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ omit = [
|
|||||||
github_url = "https://github.com/jupyterhub/the-littlest-jupyterhub"
|
github_url = "https://github.com/jupyterhub/the-littlest-jupyterhub"
|
||||||
|
|
||||||
[tool.tbump.version]
|
[tool.tbump.version]
|
||||||
current = "1.0.1.dev"
|
current = "2.0.0.dev"
|
||||||
regex = '''
|
regex = '''
|
||||||
(?P<major>\d+)
|
(?P<major>\d+)
|
||||||
\.
|
\.
|
||||||
|
|||||||
7
setup.py
7
setup.py
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="the-littlest-jupyterhub",
|
name="the-littlest-jupyterhub",
|
||||||
version="1.0.1.dev",
|
version="2.0.0.dev",
|
||||||
description="A small JupyterHub distribution",
|
description="A small JupyterHub distribution",
|
||||||
url="https://github.com/jupyterhub/the-littlest-jupyterhub",
|
url="https://github.com/jupyterhub/the-littlest-jupyterhub",
|
||||||
author="Jupyter Development Team",
|
author="Jupyter Development Team",
|
||||||
@@ -10,15 +10,16 @@ setup(
|
|||||||
license="3 Clause BSD",
|
license="3 Clause BSD",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
python_requires=">=3.9",
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"ruamel.yaml==0.17.*",
|
"ruamel.yaml==0.18.*",
|
||||||
"jinja2",
|
"jinja2",
|
||||||
"pluggy==1.*",
|
"pluggy==1.*",
|
||||||
"backoff",
|
"backoff",
|
||||||
"filelock",
|
"filelock",
|
||||||
"requests",
|
"requests",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
"jupyterhub-traefik-proxy==1.*",
|
"jupyterhub-traefik-proxy==2.*",
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": [
|
"console_scripts": [
|
||||||
|
|||||||
@@ -143,18 +143,21 @@ def test_remove_from_config_error():
|
|||||||
|
|
||||||
|
|
||||||
def test_reload_hub():
|
def test_reload_hub():
|
||||||
with mock.patch("tljh.systemd.restart_service") as restart_service, mock.patch(
|
with (
|
||||||
"tljh.systemd.check_service_active"
|
mock.patch("tljh.systemd.restart_service") as restart_service,
|
||||||
) as check_active, mock.patch("tljh.config.check_hub_ready") as check_ready:
|
mock.patch("tljh.systemd.check_service_active") as check_active,
|
||||||
|
mock.patch("tljh.config.check_hub_ready") as check_ready,
|
||||||
|
):
|
||||||
config.reload_component("hub")
|
config.reload_component("hub")
|
||||||
restart_service.assert_called_with("jupyterhub")
|
restart_service.assert_called_with("jupyterhub")
|
||||||
check_active.assert_called_with("jupyterhub")
|
check_active.assert_called_with("jupyterhub")
|
||||||
|
|
||||||
|
|
||||||
def test_reload_proxy(tljh_dir):
|
def test_reload_proxy(tljh_dir):
|
||||||
with mock.patch("tljh.systemd.restart_service") as restart_service, mock.patch(
|
with (
|
||||||
"tljh.systemd.check_service_active"
|
mock.patch("tljh.systemd.restart_service") as restart_service,
|
||||||
) as check_active:
|
mock.patch("tljh.systemd.check_service_active") as check_active,
|
||||||
|
):
|
||||||
config.reload_component("proxy")
|
config.reload_component("proxy")
|
||||||
restart_service.assert_called_with("traefik")
|
restart_service.assert_called_with("traefik")
|
||||||
check_active.assert_called_with("traefik")
|
check_active.assert_called_with("traefik")
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
#
|
#
|
||||||
jupyterhub>=5.1.0,<6
|
jupyterhub>=5.1.0,<6
|
||||||
jupyterhub-systemdspawner>=1.0.1,<2
|
jupyterhub-systemdspawner>=1.0.1,<2
|
||||||
jupyterhub-firstuseauthenticator>=1.0.0,<2
|
jupyterhub-firstuseauthenticator>=1.1.0,<2
|
||||||
jupyterhub-nativeauthenticator>=1.2.0,<2
|
jupyterhub-nativeauthenticator>=1.3.0,<2
|
||||||
jupyterhub-ldapauthenticator>=1.3.2,<2
|
jupyterhub-ldapauthenticator==2.0.0b2 # FIXME: update to >=2.0.0,<3
|
||||||
jupyterhub-tmpauthenticator>=1.0.0,<2
|
jupyterhub-tmpauthenticator>=1.0.0,<2
|
||||||
oauthenticator>=17,<18
|
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
|
# pycurl is installed to improve reliability and performance for when JupyterHub
|
||||||
# makes web requests. JupyterHub will use tornado's CurlAsyncHTTPClient when
|
# 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://www.tornadoweb.org/en/stable/httpclient.html#module-tornado.simple_httpclient
|
||||||
# ref: https://github.com/jupyterhub/the-littlest-jupyterhub/issues/289
|
# ref: https://github.com/jupyterhub/the-littlest-jupyterhub/issues/289
|
||||||
#
|
#
|
||||||
pycurl>=7.45.2,<8
|
pycurl>=7.45.3,<8
|
||||||
|
|||||||
Reference in New Issue
Block a user