|
1 | | -from distutils.core import setup |
2 | | -from distutils.extension import Extension |
3 | | -import os |
| 1 | +from setuptools import setup, Extension |
4 | 2 |
|
5 | 3 | from Cython.Build import cythonize |
6 | 4 |
|
7 | | -LIBGRAPHQLPARSER_HOME = os.environ.get('LIBGRAPHQLPARSER_HOME', './libgraphqlparser') |
8 | | - |
| 5 | +extensions = cythonize([ |
| 6 | + Extension('graphql_parser.{}'.format(cls_name), |
| 7 | + ['graphql_parser/{}.pyx'.format(cls_name)], |
| 8 | + libraries=['graphqlparser'], |
| 9 | + include_dirs=['.']) |
| 10 | + for cls_name in ['GraphQLParser', 'GraphQLAstVisitor', |
| 11 | + 'GraphQLAst', 'GraphQLAstNode'] |
| 12 | +]) |
9 | 13 |
|
10 | 14 | setup( |
11 | 15 | name='graphqlparser', |
12 | | - version='0.0.1', |
| 16 | + version='0.0.2', |
13 | 17 | author='Marco Paolini', |
14 | 18 | |
15 | 19 | description='Python bindings for libgraphqlparser (Cython-based)', |
| 20 | + long_description='Graphql parser based on libgraphql with Cython-based bindings', |
16 | 21 | url='https://github.com/elastic-coders/py-graphqlparser', |
17 | | - ext_modules=cythonize( |
18 | | - Extension("grahpql_parser", |
19 | | - ["graphql_parser/GraphQLParser.pyx", |
20 | | - "graphql_parser/GraphQLAstVisitor.pyx", |
21 | | - "graphql_parser/GraphQLAst.pyx", |
22 | | - "graphql_parser/GraphQLAstNode.pyx"], |
23 | | - libraries=['graphqlparser'], |
24 | | - library_dirs=[LIBGRAPHQLPARSER_HOME] |
25 | | - ) |
26 | | - ), |
| 22 | + packages=['graphql_parser'], |
| 23 | + ext_modules=extensions, |
27 | 24 | classifiers=[ |
28 | 25 | 'Development Status :: 3 - Alpha', |
29 | 26 | 'Environment :: Console', |
|
0 commit comments