| 1 |
#!/usr/bin/env python |
| 2 |
import os |
| 3 |
from subprocess import check_call |
| 4 |
import sys |
| 5 |
|
| 6 |
version = os.environ['JUPYTERHUB_VERSION'] |
| 7 |
|
| 8 |
pip_install = [ |
| 9 |
sys.executable, |
| 10 |
'-m', |
| 11 |
'pip', |
| 12 |
'install', |
| 13 |
'--no-cache', |
| 14 |
'--upgrade', |
| 15 |
'--upgrade-strategy', |
| 16 |
'only-if-needed', |
| 17 |
] |
| 18 |
if version.startswith("git:"): |
| 19 |
ref = version.partition(":")[-1] |
| 20 |
req = f"https://github.com/jupyterhub/jupyterhub/archive/{ref}.tar.gz" |
| 21 |
else: |
| 22 |
req = f"jupyterhub=={version}" |
| 23 |
|
| 24 |
check_call(pip_install + [req]) |