mirror of
https://github.com/ryanvolz/radioconda.git
synced 2025-08-09 16:52:27 -04:00
Write overridden env vars to Windows environment yaml file.
This commit is contained in:
parent
a8789e7ddb
commit
35aacbb9b7
@ -238,4 +238,9 @@ dependencies:
|
|||||||
- zstd=1.5.2=h6255e5f_0
|
- zstd=1.5.2=h6255e5f_0
|
||||||
name: radioconda
|
name: radioconda
|
||||||
platform: win-64
|
platform: win-64
|
||||||
|
variables:
|
||||||
|
GRC_BLOCKS_PATH: ''
|
||||||
|
GR_PREFIX: ''
|
||||||
|
UHD_PKG_PATH: ''
|
||||||
|
VOLK_PREFIX: ''
|
||||||
version: 2022.02.07
|
version: 2022.02.07
|
||||||
|
11
rerender.py
11
rerender.py
@ -38,6 +38,7 @@ def write_env_file(
|
|||||||
file_path: pathlib.Path,
|
file_path: pathlib.Path,
|
||||||
name: Optional[str] = None,
|
name: Optional[str] = None,
|
||||||
version: Optional[str] = None,
|
version: Optional[str] = None,
|
||||||
|
variables: Optional[dict] = None,
|
||||||
):
|
):
|
||||||
env_dict = dict(
|
env_dict = dict(
|
||||||
name=name,
|
name=name,
|
||||||
@ -50,6 +51,8 @@ def write_env_file(
|
|||||||
env_dict["name"] = name
|
env_dict["name"] = name
|
||||||
if version:
|
if version:
|
||||||
env_dict["version"] = version
|
env_dict["version"] = version
|
||||||
|
if variables:
|
||||||
|
env_dict["variables"] = variables
|
||||||
with file_path.open("w") as f:
|
with file_path.open("w") as f:
|
||||||
yaml.safe_dump(env_dict, stream=f)
|
yaml.safe_dump(env_dict, stream=f)
|
||||||
|
|
||||||
@ -186,12 +189,20 @@ def render_platforms(
|
|||||||
# lock the full environment specification to specific versions and builds
|
# lock the full environment specification to specific versions and builds
|
||||||
locked_env_spec = lock_env_spec(env_spec, conda_exe)
|
locked_env_spec = lock_env_spec(env_spec, conda_exe)
|
||||||
|
|
||||||
|
if platform.startswith("win"):
|
||||||
|
variables = dict(
|
||||||
|
GR_PREFIX="", GRC_BLOCKS_PATH="", UHD_PKG_PATH="", VOLK_PREFIX=""
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
variables = None
|
||||||
|
|
||||||
# write the full environment specification to a yaml file (to build metapackage)
|
# write the full environment specification to a yaml file (to build metapackage)
|
||||||
locked_env_dict = write_env_file(
|
locked_env_dict = write_env_file(
|
||||||
env_spec=locked_env_spec,
|
env_spec=locked_env_spec,
|
||||||
file_path=output_dir / f"{output_name}.yml",
|
file_path=output_dir / f"{output_name}.yml",
|
||||||
name=env_name,
|
name=env_name,
|
||||||
version=version,
|
version=version,
|
||||||
|
variables=variables,
|
||||||
)
|
)
|
||||||
|
|
||||||
# write the full environment specification to a lock file (to install from file)
|
# write the full environment specification to a lock file (to install from file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user