Commit 0e56145a authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

script for building on macosx wheels

parent 96187521
#!/usr/bin/env python
import os,sys,glob
import shlex,subprocess
pylist = ['2.7','3.4','3.5','3.6','3.7']
def launch_cmd(cmd,run=True,verbose=True,my_env=""):
args=shlex.split(cmd)
if verbose:
print(args)
if run:
_env=os.environ.copy()
_env=_env.update(my_env)
#subprocess.Popen(args,env=_env)
subprocess.call(args,env=_env)
def clean(py_inter,run=True):
cmd=py_inter+' setup.py clean --all'
launch_cmd(cmd,run=run)
def create_wheel(py_inter,run=True):
#cmd=py_inter+' CC=/usr/bin/cc CXX=/usr/bin/c++ setup.py bdist_wheel'
my_env={}
my_env["CC"]="/usr/bin/cc"
my_env["CXX"]="/usr/bin/c++"
cmd=py_inter+' setup.py bdist_wheel'
launch_cmd(cmd,run=run,my_env=my_env)
def repair_wheel(run=True):
for whl in glob.glob("dist/python_unsio*.whl"):
print(whl)
cmd='/Users/jcl/Library/Python/3.7/bin/delocate-wheel -w fixed-wheel '+whl
launch_cmd(cmd,run=run)
for pyp in pylist:
py_inter="python"+pyp
clean(py_inter,run=True)
create_wheel(py_inter,run=True)
repair_wheel(run=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment