Add before_build option, that runs a shell command before 'pip wheel'

This commit is contained in:
Joe Rickerby
2017-04-10 21:42:12 +01:00
parent 56f9a37165
commit 2679cb7f46
9 changed files with 147 additions and 22 deletions
+17
View File
@@ -0,0 +1,17 @@
from setuptools import setup, Extension
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.
sys.stderr.write('sys.argv \n' + str(sys.argv))
if sys.argv[-1] != '--name':
with open('version.txt') as f:
stored_version = f.read()
print('version is', stored_version)
assert stored_version == sys.version
setup(
name="spam",
ext_modules=[Extension('spam', sources=['spam.c'])],
version="0.1.0",
)