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

Update pins with macos versions

parent 59688191
...@@ -380,7 +380,7 @@ numba: ...@@ -380,7 +380,7 @@ numba:
numpy: numpy:
- 1.19.5 - 1.19.5
opencv: opencv:
- 4.5.2 - 4.5.1
pandas: pandas:
- 1.3.3 - 1.3.3
pillow: pillow:
......
...@@ -3,10 +3,20 @@ ...@@ -3,10 +3,20 @@
import click 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") @click.option("--python", required=True, help="Python version to pin, e.g. 3.8")
def update_pins(python): def update_pins(manual_pins, python):
from subprocess import check_output import subprocess
from bob.devtools.build import load_packages_from_conda_build_config from bob.devtools.build import load_packages_from_conda_build_config
...@@ -18,20 +28,29 @@ def update_pins(python): ...@@ -18,20 +28,29 @@ def update_pins(python):
reversed_package_names_map = {v: k for k, v in package_names_map.items()} reversed_package_names_map = {v: k for k, v in package_names_map.items()}
# ask mamba to create an environment with the packages # ask mamba to create an environment with the packages
env_text = check_output( try:
[ output = subprocess.run(
"mamba", [
"create", "mamba",
"--dry-run", "create",
"--override-channels", "--dry-run",
"-c", "--override-channels",
"conda-forge", "-c",
"-n", "conda-forge",
"temp_env", "-n",
f"python={python}", "temp_env",
] f"python={python}",
+ packages ]
).decode("utf-8") + packages
+ 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) print(env_text)
resolved_packages = [] 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