Rename setup.py template to setup.py.tmpl to avoid confusion

This commit is contained in:
Jason Paryani
2014-09-04 18:44:42 -07:00
parent 2db935a00b
commit ece4e36329
2 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python
from distutils.core import setup
from Cython.Build import cythonize
import os
import re
files = [{% for f in code.requestedFiles %}"{{f.filename}}",{% endfor %}]
for f in files:
cpp_file = f + '.cpp'
if not os.path.exists(cpp_file):
if not os.path.exists(f + '.c++'):
raise RuntimeError("You need to run `capnp compile -oc++` in addition to `-ocython` first.")
os.rename(f + '.c++', cpp_file)
with open(f + '.h', "r") as file:
lines = file.readlines()
with open(f + '.h', "w") as file:
for line in lines:
file.write(re.sub(r'Builder\(\)\s*=\s*delete;', 'Builder() = default;', line))
setup(
name="{{code.requestedFiles[0] | replace('.', '_')}}",
ext_modules=cythonize('*_capnp_cython.pyx', language="c++")
)