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
FSL
conda
manifest-rules
Commits
106c5877
Commit
106c5877
authored
Nov 25, 2021
by
Paul McCarthy
🚵
Browse files
RF: Move platform id gen code to function for reuse
parent
0094a837
Changes
2
Hide whitespace changes
Inline
Side-by-side
manifest_rules/generate_environment_files.py
View file @
106c5877
...
...
@@ -18,6 +18,7 @@ import sys
from
fsl_ci.conda
import
get_channel_packages
from
manifest_rules.utils
import
(
load_release_info
,
get_platform_identifiers
,
generate_environment_file_name
,
generate_development_version_identifier
)
...
...
@@ -87,14 +88,9 @@ def generate_variants(release_info):
"""Generate a list of (platform, cudaver) pairs for which an environment
file should be generated. For non-CUDA environments, cudaver will be None.
"""
cudas
=
[
None
]
+
list
(
release_info
[
'cuda'
])
platforms
=
os
.
environ
.
get
(
'FSLCONDA_PLATFORMS'
,
None
)
if
platforms
is
None
:
platforms
=
list
(
release_info
[
'miniconda'
].
keys
())
else
:
platforms
=
platforms
=
platforms
.
split
(
','
)
variants
=
list
(
it
.
product
(
platforms
,
cudas
))
cudas
=
[
None
]
+
list
(
release_info
[
'cuda'
])
platforms
=
get_platform_identifiers
(
release_info
)
variants
=
list
(
it
.
product
(
platforms
,
cudas
))
# CUDA builds are only supported
# on linux-64 at this time
...
...
manifest_rules/utils.py
View file @
106c5877
...
...
@@ -174,6 +174,18 @@ def load_release_info(fsl_release_file):
return
yaml
.
load
(
f
.
read
(),
Loader
=
yaml
.
Loader
)
def
get_platform_identifiers
(
release_info
):
"""Returns a list of all platform identifiers for which FSL environment
files are being generated, e.g. ['linux-64', 'macos-64', 'macos-M1'].
"""
platforms
=
os
.
environ
.
get
(
'FSLCONDA_PLATFORMS'
,
None
)
if
platforms
is
None
:
platforms
=
list
(
release_info
[
'miniconda'
].
keys
())
else
:
platforms
=
platforms
.
split
(
','
)
return
platforms
@
contextlib
.
contextmanager
def
tempdir
():
"""Returns a context manager which creates, changes into, and returns a
...
...
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