Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
infrastructure
unsio
Commits
0e56145a
Commit
0e56145a
authored
Sep 10, 2018
by
LAMBERT Jean-charles
Browse files
script for building on macosx wheels
parent
96187521
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/wheels/macosx/build_wheel.py
0 → 100644
View file @
0e56145a
#!/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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment