Skip to content

Commit 03c2754

Browse files
author
Marco Paolini
committed
Include cython files in source distribution
Also converted documentation to rst
1 parent 8553651 commit 03c2754

File tree

5 files changed

+50
-9
lines changed

5 files changed

+50
-9
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ __pycache__
88
/.tox
99
/.cache
1010
/dist/
11-
11+
/*.egg-info

MANIFEST.in

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
recursive-include examples *.py
2+
recursive-include ast *.py
3+
recursive-include graphql_parser *.pyx *.pxd
4+
recursive-exclude graphql_parser *.c *.h *.cpp
5+
include NEWS.rst

NEWS.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
News
2+
----
3+
4+
v0.0.3
5+
------
6+
7+
- fixed packaging and building

README.md renamed to README.rst

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# libgraphql cython port
1+
Graphql parser based on libgraphqlparser
2+
=========================================
23

34
Python2.7+ Python3.4+ class-based bindings to libgraphqlparser
45

@@ -7,7 +8,25 @@ See usage example in `examples/visitor_example.py`
78
Still **EXPERIMENTAL**
89

910

10-
## Building from source
11+
Installing
12+
----------
13+
14+
Prerequisites:
15+
16+
- Install `cython`
17+
- Download and build `libgraphqlparser`
18+
19+
20+
Install using pip
21+
22+
- set an env var `$GRAPHQL_HOME` to libgraphqlparser dir
23+
- `LDFLAGS="-L$GRAPHQL_HOME" CFLAGS="-I$GRAPHQL_HOME/c -I$GRAPHQL_HOME" pip install graphqlparser`
24+
25+
26+
Building from source
27+
--------------------
28+
29+
Needed to rebuild the generate cython files from the libgraphql AST
1130

1231
- download submodules with `git checkout --recursive`
1332
- build libgraphql library in folder `./libgraphql` (python2.7 required for building)
@@ -23,20 +42,23 @@ To package with wheel:
2342
- build with `pip wheel --wheel-dir=.wheelhouse .`
2443

2544

26-
## Run
45+
Run
46+
---
2747

2848
Make sure `libgraphql` is available to the loader in your `LD_LIBRARY_PATH`
2949

3050

31-
## Known issues
51+
Known issues
52+
------------
3253

3354
- Only (lightly) tested on python3
3455
- Unicode string handling not yet complete (a mixture of bytes and strings all over)
3556
- Exceptions in the visitor's class callbacks are ignored
3657
- libgraphqlparser is **dynamically** linked but It would be better if it was linked statically
3758

3859

39-
## TODO
60+
TODO
61+
----
4062

41-
- build and upload wheels to pypi
63+
- make wheels available on github
4264
- build more wheel packages for linux 32 bit and other platforms

setup.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# coding: utf-8
2+
13
from setuptools import setup, Extension
24

35
from Cython.Build import cythonize
@@ -13,13 +15,18 @@
1315

1416
setup(
1517
name='graphqlparser',
16-
version='0.0.2',
18+
version='0.0.3',
1719
author='Marco Paolini',
1820
author_email='[email protected]',
1921
description='Python bindings for libgraphqlparser (Cython-based)',
20-
long_description='Graphql parser based on libgraphql with Cython-based bindings',
22+
long_description='\n\n'.join([open('README.rst', 'r').read(),
23+
'-----', '-----',
24+
open('NEWS.rst', 'r').read()]),
2125
url='https://github.com/elastic-coders/py-graphqlparser',
2226
packages=['graphql_parser'],
27+
install_requires=['cython'],
28+
package_data={'graphql_parser': ['*.pxd', '*.pyx']},
29+
include_package_data=True,
2330
ext_modules=extensions,
2431
classifiers=[
2532
'Development Status :: 3 - Alpha',

0 commit comments

Comments
 (0)