Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
8865338c
Commit
8865338c
authored
Oct 05, 2021
by
Amir MOHAMMADI
Browse files
Update pins with macos versions
parent
59688191
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/devtools/data/conda_build_config.yaml
View file @
8865338c
...
...
@@ -380,7 +380,7 @@ numba:
numpy
:
-
1.19.5
opencv
:
-
4.5.
2
-
4.5.
1
pandas
:
-
1.3.3
pillow
:
...
...
bob/devtools/scripts/update_pins.py
View file @
8865338c
...
...
@@ -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,20 +28,29 @@ 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
(
[
"mamba"
,
"create"
,
"--dry-run"
,
"--override-channels"
,
"-c"
,
"conda-forge"
,
"-n"
,
"temp_env"
,
f
"python=
{
python
}
"
,
]
+
packages
).
decode
(
"utf-8"
)
try
:
output
=
subprocess
.
run
(
[
"mamba"
,
"create"
,
"--dry-run"
,
"--override-channels"
,
"-c"
,
"conda-forge"
,
"-n"
,
"temp_env"
,
f
"python=
{
python
}
"
,
]
+
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
)
resolved_packages
=
[]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment