forked from geatpy-dev/geatpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
88 lines (82 loc) · 2.81 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
81
82
83
84
85
86
87
88
# -*- 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 [email protected]
import pathlib
import platform
import shutil
import sys
from Cython.Build import cythonize
import numpy as np
import setuptools
from setuptools import setup
kwargs = dict(
name="geatpy",
version="2.7.0",
description=("Geatpy is a high-performance "
"Genetic and Evolutionary Algorithms toolbox for Python."),
author="Geatpy Team",
author_email="[email protected]",
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',
],
extras_require={
"dev": [
"yapf>=0.32",
"flake8>=4.0",
"isort>=5.10",
"commitizen>=2.26",
"pre-commit>=2.17",
"toml>=0.10"
],
"test": ["pytest>=7.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',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
long_description=(
"Geatpy--The Genetic and Evolutionary Algorithms Toolbox for Python. "
"http://www.geatpy.com"),
zip_safe=False,
)
dest_path = pathlib.Path('geatpy/core/')
source_path = pathlib.Path('_core/')
if dest_path.exists():
shutil.rmtree(dest_path)
dest_path.mkdir()
python_version = 'v{}.{}'.format(sys.version_info.major,
sys.version_info.minor)
core_path = (source_path / '{}'.format(platform.system())
/ 'lib{}'.format(platform.architecture()[0][:2]) / python_version)
for file in core_path.iterdir():
shutil.copy(file, dest_path / file.name)
try:
setup(include_dirs=[np.get_include()],
ext_modules=cythonize("build/build.pyx"),
language="c",
**kwargs),
except Exception:
setup(**kwargs)