Skip to content

Commit 0494274

Browse files
committed
distribute jusst the C file
update to distribute just the C file
1 parent 3ccf8d7 commit 0494274

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
recursive-include django_cemplate *
2-
global-exclude *.pyc
2+
global-exclude *.py*
3+
include *.py
4+
include django_cemplate/__init__.py

setup.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,43 @@
11
#!/usr/bin/env python
22
# coding: utf-8
33

4-
from distutils.core import setup
5-
from Cython.Build import cythonize
4+
import os
65

7-
from Cython.Compiler.Options import directive_defaults
6+
from distutils.core import setup
7+
from distutils.extension import Extension
88

99
from distutils import sysconfig
1010
site_packages_path = sysconfig.get_python_lib()
1111

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*")
1428

1529
setup(
1630
name="django_cemplate",
1731
author="Alex DAMIAN",
1832
author_email="[email protected]",
19-
version="0.99",
33+
version="1.00.rc1",
2034
license="GPL",
2135
url="https://github.com/ddalex/django-cemplate",
2236
download_url="https://github.com/ddalex/django-cemplate/releases",
2337
description="Cython-compiles django.template.[base,context,context_processors].py files for speed improvements.",
2438
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'],
2741
data_files=[(site_packages_path, ["django_cemplate.pth"])],
2842
scripts="",
2943
)

0 commit comments

Comments
 (0)