Skip to content

Commit

Permalink
Merge pull request #998 from consideRatio/pr/bump-drop
Browse files Browse the repository at this point in the history
Drop ubuntu 20.04, require py39, traefik-proxy v2, and ldapauthenticator v2
  • Loading branch information
consideRatio authored Sep 26, 2024
2 parents 2282e61 + e8602fc commit a98299c
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/integration-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
TEST_IMAGE_NAME = "test-systemd"


@functools.lru_cache()
@functools.lru_cache
def _get_container_runtime_cli():
runtimes = ["docker", "podman"]
for runtime in runtimes:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions integration-tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]


Expand Down Expand Up @@ -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+)
\.
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

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",
author_email="[email protected]",
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": [
Expand Down
15 changes: 9 additions & 6 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions tljh/requirements-hub-env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit a98299c

Please sign in to comment.