add environment evaluation

This commit is contained in:
Grzegorz Bokota
2020-06-22 13:55:04 +02:00
parent 3fe560cf14
commit c1f155c0f2
6 changed files with 24 additions and 5 deletions
+15 -1
View File
@@ -135,7 +135,21 @@ def build(options: BuildOptions) -> None:
if options.before_all:
before_all_prepared = prepare_command(options.before_all, project='/project', package=options.package_dir)
call(['docker', 'exec', '-i', container_name] + shell_cmd, universal_newlines=True, input=before_all_prepared)
task = """
PS4=' + '
set -o errexit
set -o xtrace
{environment_exports}
{before_all_prepared}
""".format(
environment_exports='\n'.join(options.environment.as_shell_commands()),
before_all_prepared=before_all_prepared
)
call(['docker', 'exec', '-i', container_name] + shell_cmd, universal_newlines=True, input=task)
for config in platform_configs:
if options.dependency_constraints:
+2 -1
View File
@@ -177,8 +177,9 @@ def build(options: BuildOptions) -> None:
repaired_wheel_dir = temp_dir / 'repaired_wheel'
if options.before_all:
env = options.environment.as_dictionary(prev_environment=os.environ)
before_all_prepared = prepare_command(options.before_all, project='.', package=options.package_dir)
call([before_all_prepared], shell=True)
call([before_all_prepared], shell=True, env=env)
python_configurations = get_python_configurations(options.build_selector)
+2 -1
View File
@@ -163,8 +163,9 @@ def build(options: BuildOptions) -> None:
download('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', nuget)
if options.before_all:
env = options.environment.as_dictionary(prev_environment=os.environ)
before_all_prepared = prepare_command(options.before_all, project='.', package=options.package_dir)
shell([before_all_prepared])
shell([before_all_prepared], env=env)
python_configurations = get_python_configurations(options.build_selector)
for config in python_configurations: