mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add Debian >10 to supported distros
This commit is contained in:
@@ -130,7 +130,6 @@ progress_page_html = """
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# This function is needed both by the process starting this script, and by the
|
||||
# TLJH installer that this script execs in the end. Make sure its replica at
|
||||
# tljh/utils.py stays in sync with this version!
|
||||
@@ -199,12 +198,15 @@ def ensure_host_system_can_install_tljh():
|
||||
# Require Ubuntu 18.04+
|
||||
distro = get_os_release_variable("ID")
|
||||
version = float(get_os_release_variable("VERSION_ID"))
|
||||
if distro != "ubuntu":
|
||||
print("The Littlest JupyterHub currently supports Ubuntu Linux only")
|
||||
if distro in ["ubuntu", "debian"]:
|
||||
print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only")
|
||||
sys.exit(1)
|
||||
elif float(version) < 18.04:
|
||||
elif distro == "ubuntu" and float(version) < 18.04:
|
||||
print("The Littlest JupyterHub requires Ubuntu 18.04 or higher")
|
||||
sys.exit(1)
|
||||
elif distro == "debian" and float(version) < 10:
|
||||
print("The Littlest JupyterHub requires Debian 10 or higher")
|
||||
sys.exit(1)
|
||||
|
||||
# Require Python 3.6+
|
||||
if sys.version_info < (3, 6):
|
||||
@@ -224,6 +226,7 @@ def ensure_host_system_can_install_tljh():
|
||||
"For local development, see http://tljh.jupyter.org/en/latest/contributing/dev-setup.html"
|
||||
)
|
||||
sys.exit(1)
|
||||
return distro, version
|
||||
|
||||
|
||||
class ProgressPageRequestHandler(SimpleHTTPRequestHandler):
|
||||
@@ -259,7 +262,7 @@ def main():
|
||||
start a local webserver temporarily and report its installation progress via
|
||||
a web site served locally on port 80.
|
||||
"""
|
||||
ensure_host_system_can_install_tljh()
|
||||
distro, version = ensure_host_system_can_install_tljh()
|
||||
|
||||
# Various related constants
|
||||
install_prefix = os.environ.get("TLJH_INSTALL_PREFIX", "/opt/tljh")
|
||||
@@ -345,7 +348,8 @@ def main():
|
||||
["apt-get", "install", "--yes", "software-properties-common"],
|
||||
env=apt_get_adjusted_env,
|
||||
)
|
||||
run_subprocess(["add-apt-repository", "universe", "--yes"])
|
||||
if distro == "ubuntu"
|
||||
run_subprocess(["add-apt-repository", "universe", "--yes"])
|
||||
run_subprocess(["apt-get", "update"])
|
||||
run_subprocess(
|
||||
[
|
||||
@@ -356,6 +360,7 @@ def main():
|
||||
"python3-venv",
|
||||
"python3-pip",
|
||||
"git",
|
||||
"sudo",
|
||||
],
|
||||
env=apt_get_adjusted_env,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user