Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 581bb79

Browse files
committed
ENH: Vendorize tempita.
Copy tempita from https://github.com/gjhiggins/tempita with a few changes to remove the six dependency. This removes a dependency on Cython's tempita, which is not to be relied on as it is considered by the Cython folks to be an implementation detail. The package is named npy_tempita so that it can always be distinguished from an installed tempita. The cythonize.py script is changed to use the vendorized tempita.
1 parent 0887da9 commit 581bb79

File tree

6 files changed

+1561
-16
lines changed

6 files changed

+1561
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,4 @@ benchmarks/numpy
150150
# cythonized files
151151
cythonize.dat
152152
numpy/random/mtrand/mtrand.c
153+
numpy/random/mtrand/randint_helpers.pxi

tools/cythonize.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,8 @@ def process_pyx(fromfile, tofile):
8383
raise OSError('Cython needs to be installed')
8484

8585
def process_tempita_pyx(fromfile, tofile):
86-
try:
87-
try:
88-
from Cython import Tempita as tempita
89-
except ImportError:
90-
import tempita
91-
except ImportError:
92-
raise Exception('Building %s requires Tempita: '
93-
'pip install --user Tempita' % VENDOR)
86+
import npy_tempita as tempita
87+
9488
assert fromfile.endswith('.pyx.in')
9589
with open(fromfile, "r") as f:
9690
tmpl = f.read()
@@ -102,14 +96,8 @@ def process_tempita_pyx(fromfile, tofile):
10296

10397

10498
def process_tempita_pxi(fromfile, tofile):
105-
try:
106-
try:
107-
from Cython import Tempita as tempita
108-
except ImportError:
109-
import tempita
110-
except ImportError:
111-
raise Exception('Building %s requires Tempita: '
112-
'pip install --user Tempita' % VENDOR)
99+
import npy_tempita as tempita
100+
113101
assert fromfile.endswith('.pxi.in')
114102
assert tofile.endswith('.pxi')
115103
with open(fromfile, "r") as f:

0 commit comments

Comments
 (0)