Change version file path to absolute on Windows

This commit is contained in:
Joe Rickerby
2017-04-10 22:36:06 +01:00
parent ff942ad766
commit 7a2e951f48
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
{
"CIBW_BEFORE_BUILD": "{python} -c \"import sys; open('pythonversion.txt', 'w').write(sys.version)\""
"CIBW_BEFORE_BUILD": "{python} -c \"import sys; open('pythonversion.txt', 'w').write(sys.version)\"",
"CIBW_BEFORE_BUILD_WINDOWS": "{python} -c \"import sys; open('c:\\pythonversion.txt', 'w').write(sys.version)\""
}
+2 -1
View File
@@ -4,7 +4,8 @@ import sys
# here we assert that the Python version as written to version.txt in the CIBW_BEFORE_BUILD step
# is the same one as is currently running.
if sys.argv[-1] != '--name':
with open('pythonversion.txt') as f:
version_file = 'c:\\pythonversion.txt' if os.platform == 'win32' else 'pythonversion.txt'
with open(version_file) as f:
stored_version = f.read()
print('stored_version', stored_version)
print('sys.version', sys.version)