File: setup.py

package info (click to toggle)
python-ihm 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,368 kB
  • sloc: python: 30,422; ansic: 5,990; sh: 24; makefile: 20
file content (64 lines) | stat: -rwxr-xr-x 1,998 bytes parent folder | download
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
#!/usr/bin/env python

try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension
import sys
import os

VERSION = "2.7"

copy_args = sys.argv[1:]

# Allow building without the C extension
build_ext = True
if '--without-ext' in copy_args:
    build_ext = False
    copy_args.remove('--without-ext')

if sys.platform == 'win32':
    # Our use of strdup, strerror should be safe - no need for the Windows
    # compiler to warn about it; we want to use the POSIX name for strdup too
    cargs = ['-D_CRT_SECURE_NO_WARNINGS', '-D_CRT_NONSTDC_NO_WARNINGS']
else:
    cargs = []

if build_ext:
    # Use pre-built SWIG wrappers for stable releases so that end users
    # don't need SWIG installed
    wrap = "src/ihm_format_wrap_%s.c" % VERSION
    if not os.path.exists(wrap):
        wrap = "src/ihm_format.i"
    mod = [Extension("ihm._format",
                     sources=["src/ihm_format.c", "src/cmp.c", wrap],
                     include_dirs=['src'],
                     extra_compile_args=cargs,
                     swig_opts=['-keyword', '-nodefaultctor',
                                '-nodefaultdtor', '-noproxy'],
                     optional=True)]
else:
    mod = []

with open("README.md", "r") as fh:
    long_description = fh.read()

setup(name='ihm',
      version=VERSION,
      script_args=copy_args,
      description='Package for handling IHM mmCIF and BinaryCIF files',
      long_description=long_description,
      long_description_content_type="text/markdown",
      author='Ben Webb',
      author_email='ben@salilab.org',
      url='https://github.com/ihmwg/python-ihm',
      ext_modules=mod,
      packages=['ihm', 'ihm.util'],
      install_requires=['msgpack'],
      license='MIT',
      classifiers=[
          "Programming Language :: Python :: 3",
          "Operating System :: OS Independent",
          "Intended Audience :: Science/Research",
          "Topic :: Scientific/Engineering",
      ])