Commit 8865338c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Update pins with macos versions

parent 59688191
......@@ -380,7 +380,7 @@ numba:
numpy:
- 1.19.5
opencv:
- 4.5.2
- 4.5.1
pandas:
- 1.3.3
pillow:
......
......@@ -3,10 +3,20 @@
import click
@click.command()
@click.command(
epilog="""Example:
python bob/devtools/scripts/update_pins.py --python 3.8
Force specific version of packages:
python bob/devtools/scripts/update_pins.py --python 3.8 opencv=4.5.1 pytorch=1.9
"""
)
@click.argument("manual_pins", nargs=-1)
@click.option("--python", required=True, help="Python version to pin, e.g. 3.8")
def update_pins(python):
from subprocess import check_output
def update_pins(manual_pins, python):
import subprocess
from bob.devtools.build import load_packages_from_conda_build_config
......@@ -18,7 +28,8 @@ def update_pins(python):
reversed_package_names_map = {v: k for k, v in package_names_map.items()}
# ask mamba to create an environment with the packages
env_text = check_output(
try:
output = subprocess.run(
[
"mamba",
"create",
......@@ -31,7 +42,15 @@ def update_pins(python):
f"python={python}",
]
+ packages
).decode("utf-8")
+ list(manual_pins),
capture_output=True,
check=True,
)
except subprocess.CalledProcessError as e:
print(e.output.decode())
raise e
env_text = output.stdout.decode("utf-8")
print(env_text)
resolved_packages = []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment