Skip to content

Commit

Permalink
Added nodetrie submodule. Updated setup.py for nodetrie C library ext…
Browse files Browse the repository at this point in the history
…ension building. Updated cython templates test
  • Loading branch information
Dan committed Mar 16, 2017
1 parent b20c336 commit 9900035
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "nodetrie"]
path = nodetrie
url = https://github.com/NodeTrie/NodeTrie_Py.git
1 change: 1 addition & 0 deletions nodetrie
Submodule nodetrie added at 0d39dd
26 changes: 20 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,28 @@

ext = 'pyx' if USING_CYTHON else 'c'

extensions = [Extension("influxgraph.ext.classes.tree",
["influxgraph/ext/classes/tree.%s" % (ext,)]),
Extension("influxgraph.ext.templates",
["influxgraph/ext/templates.%s" % (ext,)]),]
extensions = [Extension("influxgraph.ext.templates",
["influxgraph/ext/templates.%s" % (ext,)],
extra_compile_args=["-O3"],
),
Extension("influxgraph.ext.nodetrie",
["nodetrie/nodetrie/nodetrie.c",
"nodetrie/nodetrie_c/src/node.c",],
depends=["nodetrie/nodetrie_c/src/node.h"],
include_dirs=["nodetrie/nodetrie_c/src"],
extra_compile_args=["-std=c99", "-O3"],
),
]

if USING_CYTHON:
extensions = cythonize(extensions)

extensions = cythonize(
extensions,
compiler_directives={'embedsignature': True,
'optimize.use_switch': True,
'boundscheck': False,
'wraparound': False,
})

ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)

class BuildFailed(Exception):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_c_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self):
def test_parse_series_missing_fields(self):
templates = parse_influxdb_graphite_templates(
['measurement.field*'])
paths = ['series1,id=1', u'series2,id=1']
paths = [u'series1,id=1', u'series2,id=1']
fields = {}
series = parse_series(paths, fields, templates)
self.assertTrue(len(series.children) == 0)
Expand Down

0 comments on commit 9900035

Please sign in to comment.