-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
58 lines (51 loc) · 2.2 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
#!/usr/bin/env python
# This setup.py builds xylib as a python extension, which is experimental.
# The normal way of building xylib is using configure && make. Or cmake.
long_description="""\
xylib is a library for reading obscure file formats with data from
powder diffraction, spectroscopy and other experimental methods.
For the list of supported formats see https://github.com/wojdyr/xylib .
This module includes bindings to xylib and xylib itself.
The first two numbers in the version are the version of included xylib.
Prerequisites for building: SWIG and Boost libraries (headers only).
"""
from setuptools import setup
from distutils.core import Extension
from distutils.command.sdist import sdist
from glob import glob
import sys
# as per http://stackoverflow.com/a/21236111/104453
from distutils.command.build import build
class CustomBuild(build):
sub_commands = [('build_ext', build.has_ext_modules),
('build_py', build.has_pure_modules),
('build_clib', build.has_c_libraries),
('build_scripts', build.has_scripts)]
sources = glob('xylib/*.cpp') + ['xylib.i']
swig_opts = ['-c++', '-modern', '-modernargs']
if sys.version_info[0] == 3:
swig_opts += ['-py3']
setup(name='xylib-py',
version='1.6.1',
description='Python bindings to xylib',
long_description=long_description,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Software Development :: Libraries :: Python Modules',
],
author='Marcin Wojdyr',
author_email='[email protected]',
license='LGPL2.1',
url='https://github.com/wojdyr/xylib',
ext_modules=[Extension('_xylib',
sources=sources,
language='c++',
swig_opts=swig_opts,
include_dirs=['.'],
libraries=[])],
py_modules=['xylib'],
cmdclass={'build': CustomBuild})