Skip to content

Commit

Permalink
build pip add zip option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminjie committed Dec 1, 2020
1 parent 458533b commit 5ad2abe
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions openseespy-pip/build_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def copy_mac_library(so):
os.remove(mac+'lib/Python')


def build_pip(pyexe='python'):
def build_pip(pyexe='python', use_zip=False):

print('==============================================================')
print('Did you remember to update version number in opensees source?')
Expand All @@ -86,7 +86,10 @@ def build_pip(pyexe='python'):
'setuptools', 'wheel', 'twine', 'pytest'])

# compile wheel
subprocess.run([pyexe, 'setup.py', 'bdist_wheel'])
if use_zip:
subprocess.run([pyexe, 'setup.py', 'bdist', 'format=zip'])
else:
subprocess.run([pyexe, 'setup.py', 'bdist_wheel'])


def upload_pip(pyexe='python'):
Expand Down Expand Up @@ -123,18 +126,21 @@ def install_pip(pyexe='python'):
exit()

if sys.argv[1] == 'build':
if len(sys.argv) < 5:
print('buld_pip build so copy_dep/no_copy pyexe')
if len(sys.argv) < 6:
print('buld_pip build so copy_dep/no_copy pyexe use_zip')
exit()

so = sys.argv[2]
copy_dep = False
if sys.argv[3] == 'copy_dep':
copy_dep = True
pyexe = sys.argv[4]
use_zip = False
if sys.argv[5] == 'use_zip':
use_zip = True

copy_linux_library(so, copy_dep=copy_dep)
build_pip(pyexe)
build_pip(pyexe, use_zip=use_zip)

elif sys.argv[1] == 'upload-test':

Expand Down

0 comments on commit 5ad2abe

Please sign in to comment.