-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
58 lines (52 loc) · 1.83 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from distutils.core import setup
import subprocess
from distutils.command.build import build as DistutilsBuild
from setuptools import find_packages
import sys
from os import chdir
VERSION = '0.8.0'
from distutils.util import get_platform
try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
#Using compiled code that depends on the plataform
self.plat_name = get_platform()
_bdist_wheel.finalize_options(self)
self.root_is_pure = True
except ImportError:
bdist_wheel = None
class MyBuild(DistutilsBuild):
def run(self):
chdir('spclustering')
print('running makefile:')
try:
if subprocess.call(['make','makelib']) != 0:
sys.exit(-1)
subprocess.call(['make','clean'])
except FileNotFoundError:
if subprocess.call(['mingw32-make','makelib']) != 0: #in windows try to run mingw32-make instead
sys.exit(-1)
chdir('..')
long_description = open("README.md").read()
setup(name='spclustering',
version=VERSION,
description='Python Wrapper for Superparamagnetic Clustering',
long_description=long_description,
long_description_content_type="text/markdown",
author='Fernando Julian Chaure',
author_email='[email protected]',
url='https://github.com/ferchaure/SPC/',
packages=['spclustering'],
cmdclass={#'install': MyInstall
'build': MyBuild,'bdist_wheel': bdist_wheel
},
package_data={"": ["*.c","*.h","Makefile",'spclib.so']},
install_requires=['numpy','matplotlib'],
keywords=['clustering'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
)