forked from geatpy-dev/geatpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
80 lines (72 loc) · 2.59 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- coding: utf-8 -*-
# This is a list of files to install Geatpy
#
# Geatpy is a free toolbox: you can redistribute it and/or modify as you want.
#
# Geatpy is distributed in the hope that it will be useful for the genetic
# and evolutionary algorithm, you can get the tutorial from http://www.geatpy.com
#
# If you want to donate to it, please email geatpy@163.com
import os
import sys
import shutil
import platform
import numpy as np
import setuptools
from Cython.Build import cythonize
from setuptools import setup
LONG_DESCRIPTION = "Geatpy--The Genetic and Evolutionary Algorithms Toolbox for Python. http://www.geatpy.com"
kwargs = dict(name = "geatpy",
version = "2.6.0",
description = "Geatpy is a high-performance Genetic and Evolutionary Algorithms toolbox for Python.",
author = "Geatpy Team",
author_email = "geatpy@163.com",
url = "http://www.geatpy.com",
packages=setuptools.find_packages(),
include_package_data = True, # Enabled list file: MANIFEST.in
install_requires=[
'numpy>=1.17.0',
'matplotlib>=3.0.0',
'scipy>=1.0.0',
],
platforms='any',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
long_description = LONG_DESCRIPTION,
zip_safe = False,
)
dest_path = 'geatpy/core/'
source_path = '_core/'
def findAndCopy(path):
for files in os.listdir(path):
name = os.path.join(path, files)
if os.path.isfile(name):
shutil.copy(name, dest_path + files)
# delete the exist files
def findAndDel(path):
for files in os.listdir(path):
name = os.path.join(path, files)
if os.path.isfile(name):
os.remove(name)
# copy the core files
if os.path.exists(dest_path) == False:
os.makedirs(dest_path)
core_path = source_path + platform.system() + '/lib' + platform.architecture()[0][:2] + '/v' + sys.version[:3]
findAndDel(dest_path)
findAndCopy(core_path)
try:
setup(include_dirs=[np.get_include()],ext_modules=cythonize("build/build.pyx"),language="c", **kwargs),
except Exception:
setup(**kwargs)