From d476d2e053f937c0060f696312f301591e4f43ea Mon Sep 17 00:00:00 2001 From: brenda-br Date: Thu, 23 Feb 2023 22:14:39 +0530 Subject: Restructure Code -1 --- src/main/python/OMChem/setup.py | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/main/python/OMChem/setup.py (limited to 'src/main/python/OMChem/setup.py') diff --git a/src/main/python/OMChem/setup.py b/src/main/python/OMChem/setup.py new file mode 100644 index 0000000..037da1c --- /dev/null +++ b/src/main/python/OMChem/setup.py @@ -0,0 +1,54 @@ +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + +from subprocess import call +import sys +import os +# Python 3.3 offers shutil.which() +from distutils import spawn + +def warningOrError(errorOnFailure, msg): + if errorOnFailure: + raise Exception(msg) + else: + print(msg) + +def generateIDL(): + errorOnFailure = not os.path.exists(os.path.join(os.path.dirname(__file__), 'OMPythonIDL', '__init__.py')) + try: + omhome = os.path.split(os.path.split(os.path.realpath(spawn.find_executable("omc")))[0])[0] + except: + omhome = None + omhome = omhome or os.environ.get('OPENMODELICAHOME') + + if omhome is None: + warningOrError(errorOnFailure, "Failed to find OPENMODELICAHOME (searched for environment variable as well as the omc executable)") + return + idl = os.path.join(omhome,"share","omc","omc_communication.idl") + if not os.path.exists(idl): + warningOrError(errorOnFailure, "Path not found: %s" % idl) + return + + if 0 is not call(["omniidl","-bpython","-Wbglobal=_OMCIDL","-Wbpackage=OMPythonIDL",idl]): + warningOrError(errorOnFailure, "omniidl command failed") + return + print("Generated OMPythonIDL files") +generateIDL() + +setup(name='OMPython', + version='2.0.7', + description='OpenModelica-Python API Interface', + author='Anand Kalaiarasi Ganeson', + author_email='ganan642@student.liu.se', + maintainer='Adeel Asghar', + maintainer_email='adeel.asghar@liu.se', + license="BSD, OSMC-PL 1.2, GPL (user's choice)", + url='http://openmodelica.org/', + packages=['OMPython', 'OMPython.OMParser', 'OMPythonIDL', 'OMPythonIDL._OMCIDL', 'OMPythonIDL._OMCIDL__POA'], + install_requires=[ + # 'omniORB', # Required, but not part of pypi + 'pyparsing' + ] +) -- cgit From 7af3526e105cc330422f8742ec5edec1c4a0a98f Mon Sep 17 00:00:00 2001 From: brenda-br Date: Thu, 2 Mar 2023 15:49:11 +0530 Subject: Restructuring Finalized for App Bundling --- src/main/python/OMChem/setup.py | 54 ----------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/main/python/OMChem/setup.py (limited to 'src/main/python/OMChem/setup.py') diff --git a/src/main/python/OMChem/setup.py b/src/main/python/OMChem/setup.py deleted file mode 100644 index 037da1c..0000000 --- a/src/main/python/OMChem/setup.py +++ /dev/null @@ -1,54 +0,0 @@ -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -from subprocess import call -import sys -import os -# Python 3.3 offers shutil.which() -from distutils import spawn - -def warningOrError(errorOnFailure, msg): - if errorOnFailure: - raise Exception(msg) - else: - print(msg) - -def generateIDL(): - errorOnFailure = not os.path.exists(os.path.join(os.path.dirname(__file__), 'OMPythonIDL', '__init__.py')) - try: - omhome = os.path.split(os.path.split(os.path.realpath(spawn.find_executable("omc")))[0])[0] - except: - omhome = None - omhome = omhome or os.environ.get('OPENMODELICAHOME') - - if omhome is None: - warningOrError(errorOnFailure, "Failed to find OPENMODELICAHOME (searched for environment variable as well as the omc executable)") - return - idl = os.path.join(omhome,"share","omc","omc_communication.idl") - if not os.path.exists(idl): - warningOrError(errorOnFailure, "Path not found: %s" % idl) - return - - if 0 is not call(["omniidl","-bpython","-Wbglobal=_OMCIDL","-Wbpackage=OMPythonIDL",idl]): - warningOrError(errorOnFailure, "omniidl command failed") - return - print("Generated OMPythonIDL files") -generateIDL() - -setup(name='OMPython', - version='2.0.7', - description='OpenModelica-Python API Interface', - author='Anand Kalaiarasi Ganeson', - author_email='ganan642@student.liu.se', - maintainer='Adeel Asghar', - maintainer_email='adeel.asghar@liu.se', - license="BSD, OSMC-PL 1.2, GPL (user's choice)", - url='http://openmodelica.org/', - packages=['OMPython', 'OMPython.OMParser', 'OMPythonIDL', 'OMPythonIDL._OMCIDL', 'OMPythonIDL._OMCIDL__POA'], - install_requires=[ - # 'omniORB', # Required, but not part of pypi - 'pyparsing' - ] -) -- cgit From 3cbdd4238867bc860282f7cf702d73b5be6e3f86 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Sat, 4 Mar 2023 11:32:15 +0530 Subject: Revert "Restructuring Finalized for App Bundling" This reverts commit 7af3526e105cc330422f8742ec5edec1c4a0a98f. --- src/main/python/OMChem/setup.py | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/main/python/OMChem/setup.py (limited to 'src/main/python/OMChem/setup.py') diff --git a/src/main/python/OMChem/setup.py b/src/main/python/OMChem/setup.py new file mode 100644 index 0000000..037da1c --- /dev/null +++ b/src/main/python/OMChem/setup.py @@ -0,0 +1,54 @@ +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + +from subprocess import call +import sys +import os +# Python 3.3 offers shutil.which() +from distutils import spawn + +def warningOrError(errorOnFailure, msg): + if errorOnFailure: + raise Exception(msg) + else: + print(msg) + +def generateIDL(): + errorOnFailure = not os.path.exists(os.path.join(os.path.dirname(__file__), 'OMPythonIDL', '__init__.py')) + try: + omhome = os.path.split(os.path.split(os.path.realpath(spawn.find_executable("omc")))[0])[0] + except: + omhome = None + omhome = omhome or os.environ.get('OPENMODELICAHOME') + + if omhome is None: + warningOrError(errorOnFailure, "Failed to find OPENMODELICAHOME (searched for environment variable as well as the omc executable)") + return + idl = os.path.join(omhome,"share","omc","omc_communication.idl") + if not os.path.exists(idl): + warningOrError(errorOnFailure, "Path not found: %s" % idl) + return + + if 0 is not call(["omniidl","-bpython","-Wbglobal=_OMCIDL","-Wbpackage=OMPythonIDL",idl]): + warningOrError(errorOnFailure, "omniidl command failed") + return + print("Generated OMPythonIDL files") +generateIDL() + +setup(name='OMPython', + version='2.0.7', + description='OpenModelica-Python API Interface', + author='Anand Kalaiarasi Ganeson', + author_email='ganan642@student.liu.se', + maintainer='Adeel Asghar', + maintainer_email='adeel.asghar@liu.se', + license="BSD, OSMC-PL 1.2, GPL (user's choice)", + url='http://openmodelica.org/', + packages=['OMPython', 'OMPython.OMParser', 'OMPythonIDL', 'OMPythonIDL._OMCIDL', 'OMPythonIDL._OMCIDL__POA'], + install_requires=[ + # 'omniORB', # Required, but not part of pypi + 'pyparsing' + ] +) -- cgit