-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
executable file
·65 lines (55 loc) · 1.82 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
#!/usr/bin/env python
import glob
import os
import platform
try:
# We prefer to use setuptools if possible, but it isn't always available
from setuptools import setup, Extension
setup_args = dict(
entry_points = {
'console_scripts': [
'pvtree.py = cothread.tools.pvtree:main' ] },
install_requires = ['numpy'],
zip_safe = False)
except ImportError:
from distutils.core import setup, Extension
setup_args = {}
# these lines allow the version to be specified in Makefile.RELEASE
version = os.environ.get('MODULEVER', 'unknown')
# Extension module providing core coroutine functionality. Very similar in
# spirit to greenlet.
extra_compile_args = [
'-Werror',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wundef',
'-Wshadow',
'-Wcast-align',
'-Wwrite-strings',
'-Wredundant-decls',
'-Wmissing-prototypes',
'-Wmissing-declarations',
'-Wstrict-prototypes']
_coroutine = Extension('cothread._coroutine',
['context/_coroutine.c', 'context/cocore.c', 'context/switch.c'],
extra_compile_args = extra_compile_args,
depends = glob.glob('context/switch-*.c') + glob.glob('context/*.h'))
ext_modules = [_coroutine]
if platform.system() == 'Windows':
_winlib = Extension(
'cothread._winlib', ['context/_winlib.c'],
extra_compile_args = extra_compile_args)
ext_modules.append(_winlib)
setup(
name = 'cothread',
version = version,
description = 'Cooperative threading based utilities',
author = 'Michael Abbott',
author_email = '[email protected]',
url = 'http://controls.diamond.ac.uk/downloads/python/cothread/',
license = 'GPL2',
packages = ['cothread', 'cothread.tools'],
ext_modules = ext_modules,
**setup_args)