-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix setup.py for newer cython/distutil versions
- Loading branch information
Showing
1 changed file
with
13 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
import os | ||
from setuptools import setup | ||
from distutils.core import setup | ||
from distutils.extension import Extension | ||
from Cython.Distutils import build_ext | ||
|
||
import sys | ||
if 'setuptools.extension' in sys.modules: | ||
m = sys.modules['setuptools.extension'] | ||
m.Extension.__dict__ = m._Extension.__dict__ | ||
|
||
def read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
|
||
CYTHON_SOURCES = """src/p2t.pyx""".split("\n") | ||
|
||
CYTHON_SOURCES = """src/p2t.pyx""".split("\n") | ||
CPP_SOURCES = """poly2tri/common/shapes.cc | ||
poly2tri/sweep/advancing_front.cc | ||
poly2tri/sweep/cdt.cc | ||
poly2tri/sweep/sweep.cc | ||
poly2tri/sweep/sweep_context.cc""".split("\n") | ||
|
||
|
||
mod_math = Extension( | ||
"p2t", | ||
CYTHON_SOURCES + CPP_SOURCES, | ||
language = "c++" | ||
language="c++" | ||
) | ||
|
||
setup( | ||
name = "poly2tri", | ||
version = "0.3.3", | ||
author = "Mason Green", | ||
description = "A 2D constrained Delaunay triangulation library", | ||
long_description = read('README'), | ||
url = "http://code.google.com/p/poly2tri/", | ||
|
||
ext_modules = [mod_math], | ||
setup_requires = ["cython==0.14.1", "setuptools_cython==0.2.1"], | ||
install_requires = ["cython==0.14.1"], | ||
name="poly2tri", | ||
version="0.3.3", | ||
author="Mason Green", | ||
description="A 2D constrained Delaunay triangulation library", | ||
long_description=read('README'), | ||
url="http://code.google.com/p/poly2tri/", | ||
ext_modules=[mod_math], | ||
cmdclass={'build_ext': build_ext}, | ||
) |