2017-04-10 21:42:12 +01:00
|
|
|
from setuptools import setup, Extension
|
2017-09-06 22:02:10 +01:00
|
|
|
import sys, os
|
2017-04-10 21:42:12 +01:00
|
|
|
|
2018-11-29 02:44:19 +00:00
|
|
|
# assert that the Python version as written to pythonversion.txt in the CIBW_BEFORE_BUILD step
|
|
|
|
|
# is the same one as is currently running.
|
|
|
|
|
version_file = 'c:\\pythonversion.txt' if sys.platform == 'win32' else '/tmp/pythonversion.txt'
|
|
|
|
|
with open(version_file) as f:
|
|
|
|
|
stored_version = f.read()
|
|
|
|
|
print('stored_version', stored_version)
|
|
|
|
|
print('sys.version', sys.version)
|
|
|
|
|
assert stored_version == sys.version
|
2018-11-29 23:20:38 +01:00
|
|
|
|
2018-11-29 02:44:19 +00:00
|
|
|
# check that the executable also was written
|
|
|
|
|
executable_file = 'c:\\pythonexecutable.txt' if sys.platform == 'win32' else '/tmp/pythonexecutable.txt'
|
|
|
|
|
with open(executable_file) as f:
|
|
|
|
|
stored_executable = f.read()
|
|
|
|
|
print('stored_executable', stored_executable)
|
|
|
|
|
print('sys.executable', sys.executable)
|
|
|
|
|
# windows/mac are case insensitive
|
|
|
|
|
assert os.path.realpath(stored_executable).lower() == os.path.realpath(sys.executable).lower()
|
|
|
|
|
|
2017-04-10 21:42:12 +01:00
|
|
|
setup(
|
|
|
|
|
name="spam",
|
|
|
|
|
ext_modules=[Extension('spam', sources=['spam.c'])],
|
|
|
|
|
version="0.1.0",
|
|
|
|
|
)
|