-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
99 lines (90 loc) · 3.6 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
# **************************************************************************
# *
# * Authors: Grigory Sharov ([email protected]) [1]
# *
# * [1] MRC Laboratory of Molecular Biology, MRC-LMB
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU 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 General Public License for more details.
# *
# * You should have received a copy of the GNU General Public License
# * along with this program; if not, write to the Free Software
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# * 02111-1307 USA
# *
# * All comments concerning this program package may be sent to the
# * e-mail address '[email protected]'
# *
# **************************************************************************
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
import sys
from os import path
from perfectem import __version__
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
libs = []
if sys.platform.startswith("win"):
libs.append('wsock32')
serialemmodule = Extension('serialem',
define_macros=[('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
sources=['perfectem/SEM_python/SerialEMModule.cpp',
'perfectem/SEM_python/PySEMSocket.cpp'],
libraries=libs,
optional=True,
depends=['perfectem/SEM_python/PySEMSocket.h',
'perfectem/SEM_python/MacroMasterList.h'])
class BuildSEMPython(build_ext):
def run(self):
try:
import serialem
except ImportError:
build_ext.run(self)
setup(
name='perfectem',
version=__version__,
description='Run TEM performance tests with SerialEM',
long_description=long_description,
long_description_content_type='text/x-rst',
url='https://github.com/azazellochg/perfectem',
author='Grigory Sharov',
author_email='[email protected]',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 3',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows'
],
keywords='cryo-em python serialem',
packages=find_packages(),
ext_modules=[serialemmodule],
cmdclass={"build_ext": BuildSEMPython},
install_requires=['mrcfile', 'numpy', 'scipy', 'matplotlib'],
extras_require={
"dev": ["mypy"]
},
python_requires='>=3.8',
entry_points={'console_scripts': ['perfectem=perfectem:main'],
'gui_scripts': ['perfectem-gui=perfectem:main_gui']},
project_urls={
'Bug Reports': 'https://github.com/azazellochg/perfectem/issues',
'Source': 'https://github.com/azazellochg/perfectem'
}
)