Neaten the environment modification using triple-quotes and dict.update

This commit is contained in:
Joe Rickerby
2019-04-22 23:23:49 +01:00
parent 857aafbd3f
commit 9050137d2b
5 changed files with 23 additions and 13 deletions
+4 -2
View File
@@ -8,8 +8,10 @@ def test():
env = os.environ.copy()
# write python version information to a temporary file, this is checked
# in setup.py
env['CIBW_BEFORE_BUILD'] = "python -c \"import sys; open('/tmp/pythonversion.txt', 'w').write(sys.version)\" && python -c \"import sys; open('/tmp/pythonexecutable.txt', 'w').write(sys.executable)\""
env['CIBW_BEFORE_BUILD_WINDOWS'] = "python -c \"import sys; open('c:\\pythonversion.txt', 'w').write(sys.version)\" && python -c \"import sys; open('c:\\pythonexecutable.txt', 'w').write(sys.executable)\""
env.update({
'CIBW_BEFORE_BUILD': '''python -c "import sys; open('/tmp/pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('/tmp/pythonexecutable.txt', 'w').write(sys.executable)"''',
'CIBW_BEFORE_BUILD_WINDOWS': '''python -c "import sys; open('c:\\pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('c:\\pythonexecutable.txt', 'w').write(sys.executable)"''',
})
# build the wheels
subprocess.check_call([sys.executable, '-m', 'cibuildwheel', project_dir], env=env)