|
1 | 1 | #!/usr/bin/env python |
2 | 2 | # coding: utf-8 |
3 | 3 |
|
4 | | -from distutils.core import setup |
5 | | -from Cython.Build import cythonize |
| 4 | +import os |
6 | 5 |
|
7 | | -from Cython.Compiler.Options import directive_defaults |
| 6 | +from distutils.core import setup |
| 7 | +from distutils.extension import Extension |
8 | 8 |
|
9 | 9 | from distutils import sysconfig |
10 | 10 | site_packages_path = sysconfig.get_python_lib() |
11 | 11 |
|
12 | | -directive_defaults['linetrace'] = True |
13 | | -directive_defaults['binding'] = True |
| 12 | +USE_CYTHON = False |
| 13 | +extensions = [] |
| 14 | +for d, s, files in os.walk("django_cemplate"): |
| 15 | + |
| 16 | + for fname in files: |
| 17 | + if fname.endswith(".c"): |
| 18 | + basename = fname[:-2] |
| 19 | + extensions.append(Extension(os.path.join(d, basename), [os.path.join(d, fname)])) |
| 20 | + |
| 21 | +if USE_CYTHON: |
| 22 | + from Cython.Build import cythonize |
| 23 | + from Cython.Compiler.Options import directive_defaults |
| 24 | + |
| 25 | + directive_defaults['linetrace'] = True |
| 26 | + directive_defaults['binding'] = True |
| 27 | + extensions = cythonize("django_cemplate/*.py*") |
14 | 28 |
|
15 | 29 | setup( |
16 | 30 | name="django_cemplate", |
17 | 31 | author="Alex DAMIAN", |
18 | 32 | |
19 | | - version="0.99", |
| 33 | + version="1.00.rc1", |
20 | 34 | license="GPL", |
21 | 35 | url="https://github.com/ddalex/django-cemplate", |
22 | 36 | download_url="https://github.com/ddalex/django-cemplate/releases", |
23 | 37 | description="Cython-compiles django.template.[base,context,context_processors].py files for speed improvements.", |
24 | 38 | packages=["django_cemplate"], |
25 | | - ext_modules=cythonize("django_cemplate/*.py*"), |
26 | | - install_requires=['django==1.8.7', 'cython'], |
| 39 | + ext_modules=extensions, |
| 40 | + install_requires=['django==1.8.7'], |
27 | 41 | data_files=[(site_packages_path, ["django_cemplate.pth"])], |
28 | 42 | scripts="", |
29 | 43 | ) |
0 commit comments