-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
102 lines (89 loc) · 4.35 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2014-2021 Ramil Nugmanov <nougmanoff@protonmail.com>
# This file is part of CGRtools.
#
# CGRtools is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
from distutils.command.sdist import sdist
from distutils.command.build import build
from distutils.util import get_platform
from importlib.util import find_spec
from pathlib import Path
from setuptools import setup, Extension
class _sdist(sdist):
def finalize_options(self):
super().finalize_options()
self.distribution.data_files.append(('lib', ['INCHI/libinchi.so', 'INCHI/libinchi.dll']))
cmd_class = {'sdist': _sdist}
if find_spec('wheel'):
from wheel.bdist_wheel import bdist_wheel
class _bdist_wheel(bdist_wheel):
def finalize_options(self):
super().finalize_options()
self.root_is_pure = False
platform = get_platform()
if platform == 'win-amd64':
self.distribution.data_files.append(('lib', ['INCHI/libinchi.dll']))
elif platform == 'linux-x86_64':
self.distribution.data_files.append(('lib', ['INCHI/libinchi.so']))
cmd_class['bdist_wheel'] = _bdist_wheel
if find_spec('cython'):
class _build(build):
def finalize_options(self):
super().finalize_options()
from Cython.Build import cythonize
self.distribution.ext_modules = cythonize(self.distribution.ext_modules, language_level=3)
cmd_class['build'] = _build
setup(
name='CGRtools',
version='4.1.33',
packages=['CGRtools', 'CGRtools.algorithms', 'CGRtools.algorithms.calculate2d', 'CGRtools.algorithms.components',
'CGRtools.algorithms.standardize', 'CGRtools.containers', 'CGRtools.files', 'CGRtools.files._mdl',
'CGRtools.periodictable', 'CGRtools.periodictable.element', 'CGRtools.reactor', 'CGRtools.utils',
'CGRtools.attributes'],
url='https://github.com/stsouko/CGRtools',
license='LGPLv3',
author='Dr. Ramil Nugmanov',
author_email='nougmanoff@protonmail.com',
python_requires='>=3.6.1',
cmdclass=cmd_class,
ext_modules=[Extension('CGRtools.containers._unpack', ['CGRtools/containers/_unpack.pyx'],
extra_compile_args=['-O3'])],
setup_requires=['wheel', 'cython'],
install_requires=['CachedMethods>=0.1.4,<0.2'],
extras_require={'mrv': ['lxml>=4.1'], 'clean2d': ['py-mini-racer>=0.4.0'], 'jit': ['numpy>=1.18', 'numba>=0.50']},
package_data={'CGRtools.algorithms.calculate2d': ['clean2d.js'], 'CGRtools.containers': ['_unpack.pyx']},
data_files=[],
zip_safe=False,
long_description=(Path(__file__).parent / 'README.rst').read_text(),
classifiers=['Environment :: Plugins',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'],
command_options={'build_sphinx': {'source_dir': ('setup.py', 'doc'),
'build_dir': ('setup.py', 'build/doc'),
'all_files': ('setup.py', True)}}
)