Skip to content

Commit

Permalink
Remove cython from install dep
Browse files Browse the repository at this point in the history
  • Loading branch information
sepeth committed Sep 18, 2015
1 parent 594527d commit 8609564
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include pugixml/src *.hpp *.cpp
include pugixmltodict.pyx
1 change: 0 additions & 1 deletion pugixmltodict.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# distutils: language = c++
# distutils: sources = pugixml/src/pugixml.cpp

from libc.string cimport const_char
from libc.stddef cimport ptrdiff_t
Expand Down
31 changes: 27 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
from distutils.core import setup
from Cython.Build import cythonize
# coding: utf-8
import sys
from distutils.core import setup, Extension


USE_CYTHON = False
CYTHON_PARAM = '--cython'
if CYTHON_PARAM in sys.argv:
USE_CYTHON = True
sys.argv.remove(CYTHON_PARAM)


SOURCE_EXT = '.pyx' if USE_CYTHON else '.cpp'
EXT_MODULES = [Extension(
'pugixmltodict',
sources=[
'pugixmltodict' + SOURCE_EXT,
'pugixml/src/pugixml.cpp',
],
)]

if USE_CYTHON:
from Cython.Build import cythonize
EXT_MODULES = cythonize(EXT_MODULES)


setup(
name = 'pugixmltodict',
name='pugixmltodict',
version='0.1',
description='A fast alternative to xmltodict library',
url='https://github.com/sepeth/pugixmltodict',
Expand All @@ -14,9 +36,10 @@
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.7',
'Topic :: Text Processing :: Markup :: XML',
],

ext_modules = cythonize('*.pyx'),
ext_modules=EXT_MODULES,
)

0 comments on commit 8609564

Please sign in to comment.