forked from jruizgit/rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (60 loc) · 2.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
try:
from setuptools import setup, Extension
from setuptools.command import install_lib as _install_lib
except ImportError:
from distutils.core import setup, Extension
from distutils.command import install_lib as _install_lib
from codecs import open
from os import path
from os import environ
environ['CFLAGS'] = '-std=c99 -D_GNU_SOURCE'
# Patch "install_lib" command to run build_clib before build_ext
# to properly work with easy_install.
# See: http://bugs.python.org/issue5243
class install_lib(_install_lib.install_lib):
def build(self):
if not self.skip_build:
if self.distribution.has_pure_modules():
self.run_command('build_py')
if self.distribution.has_c_libraries():
self.run_command('build_clib')
if self.distribution.has_ext_modules():
self.run_command('build_ext')
rules_lib = ('rules_py',
{'sources': ['deps/hiredis/%s.c' % src for src in ('hiredis', 'net', 'sds', 'read')] +
['src/rules/%s.c' % src for src in ('json', 'net', 'rete', 'state', 'events')]})
rules = Extension('rules',
sources = ['src/rulespy/rules.c'],
include_dirs=['src/rules'])
here = path.abspath(path.dirname(__file__)) + '/docs/py'
with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
long_description = f.read()
setup (
name = 'durable_rules',
version = '0.33.73',
description = 'for real time analytics (a Python Rules Engine)',
long_description=long_description,
url='https://github.com/jruizgit/rules',
author='Jesus Ruiz',
author_email='[email protected]',
license='MIT',
classifiers=[
'Operating System :: MacOS',
'Operating System :: POSIX',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: MIT License',
'Programming Language :: C',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
keywords='rules engine rete forward chaining event stream state machine workflow streaming analytics',
install_requires=['werkzeug'],
packages = ['durable'],
package_dir = {'': 'libpy'},
libraries = [rules_lib],
ext_modules = [rules],
# Override 'install_lib' command
cmdclass={'install_lib': install_lib},
)