Skip to content

Commit 302577e

Browse files
committed
Port to libgraphqlparser 0.7.0
1 parent b34d0a2 commit 302577e

11 files changed

+23
-14
lines changed

NEWS.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
News
22
----
33

4+
v0.0.4
5+
------
6+
7+
- compatible with latest libgraphqlparser 0.7.0
8+
- built wheels for python 3.6
9+
10+
411
v0.0.3
512
------
613

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on `graphqlparser github releases`_
1616

1717
Pick the right wheel for your platform and python version, then install it using pip::
1818

19-
pip install https://github.com/elastic-coders/py-graphqlparser/releases/download/v0.0.3/graphqlparser-0.0.3-cp27-none-linux_x86_64.whl
19+
pip install https://github.com/elastic-coders/py-graphqlparser/releases/download/v0.0.4/graphqlparser-0.0.4-cp36-cp36m-linux_x86_64.whl
2020

2121

2222
As an alternative you can install ``graphqlparser`` from source distribution:

ast/ast_cython.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def start_type(self, name):
3636
print '''
3737
cdef class %(name)s(GraphQLAst):
3838
39-
cdef %(cmodule)s.%(name)s* _wrapped
39+
cdef const %(cmodule)s.%(name)s* _wrapped
4040
4141
@staticmethod
42-
cdef create(cGraphQLAst.%(name)s *thing)
42+
cdef create(const cGraphQLAst.%(name)s *thing)
4343
4444
''' % {'name': st_name, 'cmodule': ast_cython_c.CMODULE_NAME}
4545
self._current_type = name

ast/ast_cython_impl.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_%(snake)s(self):
5555
# python object return type
5656
return '''
5757
def get_%(snake)s(self):
58-
cdef %(cmodule)s.%(return_st)s *next
58+
cdef const %(cmodule)s.%(return_st)s *next
5959
next = %(cmodule)s.%(owning_st)s_get_%(snake)s(self._wrapped)
6060
if next is NULL:
6161
return None
@@ -88,7 +88,7 @@ def start_type(self, name):
8888
cdef class %(name)s(GraphQLAst):
8989
9090
@staticmethod
91-
cdef create(%(cmodule)s.%(name)s *thing):
91+
cdef create(const %(cmodule)s.%(name)s *thing):
9292
node = %(name)s()
9393
node._wrapped = thing
9494
return node

ast/ast_cython_visitor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def end_file(self):
5050

5151
print '''
5252
void graphql_node_visit(GraphQLAstNode *node,
53-
GraphQLAstVisitorCallbacks *callbacks,
53+
const GraphQLAstVisitorCallbacks *callbacks,
5454
void *userData)
5555
'''
5656

ast/ast_cython_visitor_impl.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def end_file(self):
5555
_map = {'snake': snake(type), 'name': type, 'cmodule': CMODULE_NAME}
5656
print '''
5757
58-
cdef int _visit_%(snake)s(%(cmodule)s.GraphQLAst%(name)s* node, void* userData, int end):
58+
cdef int _visit_%(snake)s(const %(cmodule)s.GraphQLAst%(name)s* node, void* userData, int end):
5959
cdef GraphQLAstVisitor visitor
6060
ast = GraphQLAst.GraphQLAst%(name)s.create(node)
6161
if userData is not NULL:
@@ -66,10 +66,10 @@ def end_file(self):
6666
retval = fun(ast)
6767
return 0 if retval is None else retval
6868
69-
cdef int visit_%(snake)s(%(cmodule)s.GraphQLAst%(name)s* node, void* userData):
69+
cdef int visit_%(snake)s(const %(cmodule)s.GraphQLAst%(name)s* node, void* userData):
7070
return _visit_%(snake)s(node, userData, 0)
7171
72-
cdef void end_visit_%(snake)s(%(cmodule)s.GraphQLAst%(name)s* node, void* userData):
72+
cdef void end_visit_%(snake)s(const %(cmodule)s.GraphQLAst%(name)s* node, void* userData):
7373
_visit_%(snake)s(node, userData, 1)
7474
''' % _map
7575

graphql_parser/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ GraphQLAstVisitor.pyx
66
*~
77
*.c
88
.python-version
9+
*.so
10+
*.html

graphql_parser/GraphQLParser.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class GraphQLParseError(Exception):
99

1010

1111
def graphql_parse_string(text):
12-
cdef char* error_c = NULL
13-
cdef char* text_c
12+
cdef const char* error_c = NULL
13+
cdef const char* text_c
1414
cdef cGraphQLAstNode.GraphQLAstNode* node_c
1515
byte_string = text.encode()
1616
text_c = byte_string

graphql_parser/cGraphQLParser.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ cdef extern from "GraphQLParser.h":
22
struct GraphQLAstNode:
33
pass
44

5-
GraphQLAstNode* graphql_parse_string(char* text, char** error)
5+
GraphQLAstNode* graphql_parse_string(const char* text, const char** error)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name='graphqlparser',
18-
version='0.0.3',
18+
version='0.0.4',
1919
author='Marco Paolini',
2020
author_email='[email protected]',
2121
description='Python bindings for libgraphqlparser (Cython-based)',

0 commit comments

Comments
 (0)