-
Notifications
You must be signed in to change notification settings - Fork 207
/
setup.py
72 lines (66 loc) · 2.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
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
from sys import platform
if platform == 'win32':
environ['CFLAGS'] = '-std=c99 -D_GNU_SOURCE -_WIN32'
elif platform == 'darwin':
environ['CFLAGS'] = '-std=c99 -D_GNU_SOURCE -fcommon'
else:
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 = ('durable_rules_engine_py', {'sources': ['src/rules/%s.c' % src for src in ('json', 'rete', 'state', 'events', 'regex')]})
rules = Extension('durable_rules_engine',
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 = '2.0.28',
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 :: OS Independent',
'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',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='rules engine rete forward chaining event stream state machine workflow streaming analytics',
packages = ['durable'],
package_dir = {'': 'libpy'},
libraries = [rules_lib],
ext_modules = [rules],
# Override 'install_lib' command
cmdclass={'install_lib': install_lib},
)