mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 02:24:08 +00:00
25 lines
496 B
Python
25 lines
496 B
Python
#!/usr/bin/env python
|
|
import os
|
|
from subprocess import check_call
|
|
import sys
|
|
|
|
version = os.environ['JUPYTERHUB_VERSION']
|
|
|
|
pip_install = [
|
|
sys.executable,
|
|
'-m',
|
|
'pip',
|
|
'install',
|
|
'--no-cache',
|
|
'--upgrade',
|
|
'--upgrade-strategy',
|
|
'only-if-needed',
|
|
]
|
|
if version.startswith("git:"):
|
|
ref = version.partition(":")[-1]
|
|
req = f"https://github.com/jupyterhub/jupyterhub/archive/{ref}.tar.gz"
|
|
else:
|
|
req = f"jupyterhub=={version}"
|
|
|
|
check_call(pip_install + [req])
|