kopia lustrzana https://github.com/jupyterhub/repo2docker
Add help message to freeze.py
rodzic
4aa1d154a1
commit
62c0de2282
|
@ -9,6 +9,7 @@ Usage:
|
||||||
python freeze.py [3.8]
|
python freeze.py [3.8]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from argparse import ArgumentParser
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
@ -106,10 +107,21 @@ def set_python(py_env_file, py):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# allow specifying which Pythons to update on argv
|
parser = ArgumentParser(
|
||||||
pys = sys.argv[1:] or ("2.7", "3.6", "3.7", "3.8", "3.9")
|
description=(
|
||||||
|
"Refreeze conda environments. See "
|
||||||
|
"https://repo2docker.readthedocs.io/en/latest/contributing/tasks.html#update-and-freeze-buildpack-dependencies"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"py",
|
||||||
|
nargs="*",
|
||||||
|
help="Python version(s) to update and freeze",
|
||||||
|
default=("2.7", "3.6", "3.7", "3.8", "3.9"),
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
default_py = "3.7"
|
default_py = "3.7"
|
||||||
for py in pys:
|
for py in args.py:
|
||||||
env_file = pathlib.Path(str(ENV_FILE_T).format(py=py))
|
env_file = pathlib.Path(str(ENV_FILE_T).format(py=py))
|
||||||
set_python(env_file, py)
|
set_python(env_file, py)
|
||||||
frozen_file = pathlib.Path(os.path.splitext(env_file)[0] + ".lock")
|
frozen_file = pathlib.Path(os.path.splitext(env_file)[0] + ".lock")
|
||||||
|
|
Ładowanie…
Reference in New Issue