Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zhuminjie/OpenSeesPy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminjie committed Oct 15, 2020
2 parents cd07262 + 40e506c commit bd11a82
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
8 changes: 1 addition & 7 deletions openseespy-pip/build_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
import glob


def copy_library(so, pyd):
def copy_linux_library(so):

# change to script's folder
os.chdir(os.path.dirname(os.path.abspath(__file__)))

# replace new libraries
linux = './openseespy/opensees/linux/'
win = './openseespy/opensees/win/'

if os.path.exists(pyd):
if os.path.exists(win+'opensees.pyd'):
os.remove(win+'opensees.pyd')
shutil.copy(pyd, win)

if os.path.exists(so):
if os.path.exists(linux+'opensees.so'):
Expand Down
5 changes: 2 additions & 3 deletions openseespy-pip/install_pip.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import subprocess

from build_pip import copy_library, build_pip, upload_pip, clean_pip
from build_pip import copy_linux_library, build_pip, upload_pip, clean_pip

copy_library('../../opensees/SRC/interpreter/opensees.so',
'../../opensees/SRC/interpreter/opensees.pyd')
copy_linux_library('../../opensees/SRC/interpreter/opensees.so')
build_pip()
upload_pip()
clean_pip()
5 changes: 2 additions & 3 deletions openseespy-pip/install_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import subprocess

from build_pip import copy_library, build_pip, upload_pip_test, clean_pip
from build_pip import copy_linux_library, build_pip, upload_pip_test, clean_pip


copy_library('../../opensees/SRC/interpreter/opensees.so',
'../../opensees/SRC/interpreter/opensees.pyd')
copy_linux_library('../../opensees/SRC/interpreter/opensees.so')
build_pip()
upload_pip_test()
clean_pip()
11 changes: 8 additions & 3 deletions openseespy-pip/openseespy/opensees/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@

elif sys.platform.startswith('darwin'):

# from openseespy.opensees.mac.opensees import *
raise RuntimeError(
'Please install Mac version from openseespymac package (pip install openseespymac)')
if sys.version_info[0] == 3 and sys.version_info[1] == 8:
try:
from openseespy.opensees.mac.opensees import *
from openseespy.opensees.win.opensees import __version__
except:
raise RuntimeError('Failed to import, try use Python from HomeBrew')
else:
raise RuntimeError('Python version 3.8 is needed for Mac')


else:
Expand Down
2 changes: 1 addition & 1 deletion openseespy-pip/openseespy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "3.2.2.5"
version = "3.2.4.14"

0 comments on commit bd11a82

Please sign in to comment.