Skip to content

Commit

Permalink
disabling conda and adding deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dwr-psandhu committed Dec 17, 2024
1 parent 8000b8a commit 643b805
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 128 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/build.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/workflows/buildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install ifort dependencies (Windows)
if: matrix.os == 'windows-latest'
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
Expand Down
118 changes: 61 additions & 57 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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],
)

0 comments on commit 643b805

Please sign in to comment.