From af2ceea59b9f4729660a687eab2200b11ca107fe Mon Sep 17 00:00:00 2001 From: arsadri Date: Sun, 9 Jul 2023 16:55:03 +1000 Subject: [PATCH] possible to install in Widnows --- RobustGaussianFittingLibrary/cWrapper.py | 3 ++- setup.py | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/RobustGaussianFittingLibrary/cWrapper.py b/RobustGaussianFittingLibrary/cWrapper.py index f2f6e31..1af68a1 100644 --- a/RobustGaussianFittingLibrary/cWrapper.py +++ b/RobustGaussianFittingLibrary/cWrapper.py @@ -15,7 +15,8 @@ import os import fnmatch -dir_path = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + '..' + os.path.sep +dir_path = os.path.dirname( + os.path.realpath(__file__)) + os.path.sep + '..' + os.path.sep fileNameTemplate = 'RGFLib*.so' flist = fnmatch.filter(os.listdir(dir_path + os.path.sep), fileNameTemplate) if(len(flist)==0): #for those who use make diff --git a/setup.py b/setup.py index e6bb42b..4e3876d 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,8 @@ from setuptools import setup from setuptools import Extension - -_version = '0.2.3' +from platform import system as platform_system +_version = '0.2.4' with open('README.md') as readme_file: readme = readme_file.read() @@ -23,6 +23,17 @@ test_requirements = ['pytest>=3', ] +more_setup_arguments = {} +if platform_system() == 'Linux': + more_setup_arguments['ext_modules'] = [ + Extension(name = 'RGFLib', + sources = ['RobustGaussianFittingLibrary/RGFLib.c'], + language = 'c', + extra_compile_args = ['-shared'])] +else: + more_setup_arguments['package_data']=\ + {'': ['RobustGaussianFittingLibrary/RGFLib.so']} + setup( author="Alireza Sadri", author_email='arsadri@gmail.com', @@ -63,8 +74,5 @@ url='https://github.com/arsadri/RobustGaussianFittingLibrary', version=_version, zip_safe=False, - ext_modules=[Extension(name = 'RGFLib', - sources = ['RobustGaussianFittingLibrary/RGFLib.c'], - language = 'c', - extra_compile_args = ['-shared'])], -) + **more_setup_arguments +) \ No newline at end of file