-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8000b8a
commit 643b805
Showing
3 changed files
with
69 additions
and
128 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
setup.py file for SWIG example | ||
""" | ||
|
||
#from distutils.core import setup, Extension | ||
# from distutils.core import setup, Extension | ||
import codecs | ||
import os | ||
import platform | ||
|
@@ -29,82 +29,86 @@ def get_numpy_include(): | |
|
||
|
||
def read(*parts): | ||
with codecs.open(os.path.join(here, *parts), 'r') as fp: | ||
with codecs.open(os.path.join(here, *parts), "r") as fp: | ||
return fp.read() | ||
|
||
|
||
with open('README.rst') as readme_file: | ||
with open("README.rst") as readme_file: | ||
readme = readme_file.read() | ||
|
||
with open('CHANGELOG.rst') as history_file: | ||
with open("CHANGELOG.rst") as history_file: | ||
history = history_file.read() | ||
|
||
requirements = ["numpy", "pandas"] | ||
|
||
setup_requirements = [] | ||
setup_requirements = ["numpy", "versioneer", "pytest-runner"] | ||
|
||
test_requirements = ['pytest'] | ||
test_requirements = ["pytest"] | ||
|
||
|
||
##------------ COMPILE LINK OPTIONS for Linux and Windows ----------------# | ||
|
||
if platform.system() == 'Linux': | ||
if platform.system() == "Linux": | ||
# https://stackoverflow.com/questions/329059/what-is-gxx-personality-v0-for | ||
extra_links = ['-fno-exceptions', '-fno-rtti', '-shared', | ||
'-lgfortran', '-lstdc++'] | ||
libs = ['heclib6-WE'] # linux | ||
libdirs = ['./extensions'] # linux | ||
compile_args = ['-D_GNU_SOURCE', '-fno-exceptions'] # linux | ||
elif platform.system() == 'Windows': | ||
extra_links = ["-fno-exceptions", "-fno-rtti", "-shared", "-lgfortran", "-lstdc++"] | ||
libs = ["heclib6-WE"] # linux | ||
libdirs = ["./extensions"] # linux | ||
compile_args = ["-D_GNU_SOURCE", "-fno-exceptions"] # linux | ||
elif platform.system() == "Windows": | ||
extra_links = ["/NODEFAULTLIB:LIBCMT"] | ||
libs = ['extensions/heclib6-VE', ] | ||
libs = [ | ||
"extensions/heclib6-VE", | ||
] | ||
libdirs = [] | ||
compile_args = [] | ||
else: | ||
raise Exception("Unknown platform: "+platform.system()+"! You are on your own") | ||
raise Exception("Unknown platform: " + platform.system() + "! You are on your own") | ||
|
||
|
||
# check_numpy_i() #--This is failing due SSL certificate issue | ||
# | ||
pyheclib_module = Extension('pyhecdss._pyheclib', | ||
sources=['pyhecdss/pyheclib.i', | ||
'pyhecdss/hecwrapper.c'], | ||
swig_opts=['-py3', ], | ||
libraries=libs, | ||
library_dirs=libdirs, | ||
extra_compile_args=compile_args, | ||
extra_link_args=extra_links, | ||
include_dirs=[get_numpy_include()], | ||
) | ||
|
||
setup(name='pyhecdss', | ||
author="Nicky Sandhu", | ||
author_email='[email protected]', | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
classifiers=[ | ||
'Development Status :: 2 - Pre-Alpha', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
], | ||
description="For reading/writing HEC-DSS files", | ||
install_requires=requirements, | ||
license="MIT license", | ||
long_description=readme + '\n\n' + history, | ||
include_package_data=True, | ||
keywords='pyhecdss', | ||
packages=find_packages(include=['pyhecdss']), | ||
setup_requires=setup_requirements, | ||
python_requires='~=3.5', | ||
test_suite='tests', | ||
tests_require=test_requirements, | ||
url='https://github.com/dwr-psandhu/pyhecdss', | ||
zip_safe=False, | ||
ext_modules=[pyheclib_module], | ||
) | ||
pyheclib_module = Extension( | ||
"pyhecdss._pyheclib", | ||
sources=["pyhecdss/pyheclib.i", "pyhecdss/hecwrapper.c"], | ||
swig_opts=[ | ||
"-py3", | ||
], | ||
libraries=libs, | ||
library_dirs=libdirs, | ||
extra_compile_args=compile_args, | ||
extra_link_args=extra_links, | ||
include_dirs=[get_numpy_include()], | ||
) | ||
|
||
setup( | ||
name="pyhecdss", | ||
author="Nicky Sandhu", | ||
author_email="[email protected]", | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
], | ||
description="For reading/writing HEC-DSS files", | ||
install_requires=requirements, | ||
license="MIT license", | ||
long_description=readme + "\n\n" + history, | ||
include_package_data=True, | ||
keywords="pyhecdss", | ||
packages=find_packages(include=["pyhecdss"]), | ||
setup_requires=setup_requirements, | ||
python_requires="~=3.5", | ||
test_suite="tests", | ||
tests_require=test_requirements, | ||
url="https://github.com/dwr-psandhu/pyhecdss", | ||
zip_safe=False, | ||
ext_modules=[pyheclib_module], | ||
) |