Remove 'setuptools' template project
This commit is contained in:
@@ -1,3 +1,2 @@
|
|||||||
from .base import TemplateProject # noqa
|
from .base import TemplateProject # noqa
|
||||||
from .c import CTemplateProject # noqa
|
from .c import CTemplateProject # noqa
|
||||||
from .setuptools import SetuptoolsTemplateProject # noqa
|
|
||||||
|
|||||||
+27
-10
@@ -1,5 +1,5 @@
|
|||||||
import jinja2
|
import jinja2
|
||||||
from .setuptools import SetuptoolsTemplateProject
|
from .base import TemplateProject
|
||||||
|
|
||||||
|
|
||||||
spam_c_template = r'''
|
spam_c_template = r'''
|
||||||
@@ -59,25 +59,42 @@ MOD_INIT(spam)
|
|||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
setup_py_template = r'''
|
||||||
|
from setuptools import setup, Extension
|
||||||
|
|
||||||
class CTemplateProject(SetuptoolsTemplateProject):
|
{{ setup_py_add }}
|
||||||
def __init__(self, *, spam_c_top_level_add='', spam_c_function_add='', setup_py_add='',
|
|
||||||
setup_py_setup_args_add='', setup_cfg_add=''):
|
setup(
|
||||||
setup_py_setup_args_add += '''
|
|
||||||
ext_modules=[Extension('spam', sources=['spam.c'])],
|
ext_modules=[Extension('spam', sources=['spam.c'])],
|
||||||
|
{{ setup_py_setup_args_add | indent(4) }}
|
||||||
|
)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
super().__init__(
|
setup_cfg_template = r'''
|
||||||
setup_py_add=setup_py_add,
|
[metadata]
|
||||||
setup_py_setup_args_add=setup_py_setup_args_add,
|
name = spam
|
||||||
setup_cfg_add=setup_cfg_add
|
version = 0.1.0
|
||||||
)
|
|
||||||
|
{{ setup_cfg_add }}
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
class CTemplateProject(TemplateProject):
|
||||||
|
def __init__(self, *, spam_c_top_level_add='', spam_c_function_add='', setup_py_add='',
|
||||||
|
setup_py_setup_args_add='', setup_cfg_add=''):
|
||||||
|
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
self.files.update({
|
self.files.update({
|
||||||
'spam.c': jinja2.Template(spam_c_template),
|
'spam.c': jinja2.Template(spam_c_template),
|
||||||
|
'setup.py': jinja2.Template(setup_py_template),
|
||||||
|
'setup.cfg': jinja2.Template(setup_cfg_template),
|
||||||
})
|
})
|
||||||
|
|
||||||
self.template_context.update({
|
self.template_context.update({
|
||||||
'spam_c_top_level_add': spam_c_top_level_add,
|
'spam_c_top_level_add': spam_c_top_level_add,
|
||||||
'spam_c_function_add': spam_c_function_add,
|
'spam_c_function_add': spam_c_function_add,
|
||||||
|
'setup_py_add': setup_py_add,
|
||||||
|
'setup_py_setup_args_add': setup_py_setup_args_add,
|
||||||
|
'setup_cfg_add': setup_cfg_add,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
|
|
||||||
import jinja2
|
|
||||||
from .base import TemplateProject
|
|
||||||
|
|
||||||
|
|
||||||
setup_py_template = r'''
|
|
||||||
from setuptools import setup, Extension
|
|
||||||
|
|
||||||
{{ setup_py_add }}
|
|
||||||
|
|
||||||
setup(
|
|
||||||
{{ setup_py_setup_args_add | indent(4) }}
|
|
||||||
)
|
|
||||||
'''
|
|
||||||
|
|
||||||
setup_cfg_template = r'''
|
|
||||||
[metadata]
|
|
||||||
name = spam
|
|
||||||
version = 0.1.0
|
|
||||||
|
|
||||||
{{ setup_cfg_add }}
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
class SetuptoolsTemplateProject(TemplateProject):
|
|
||||||
def __init__(self, *, setup_py_add='', setup_py_setup_args_add='', setup_cfg_add=''):
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
self.files.update({
|
|
||||||
'setup.py': jinja2.Template(setup_py_template),
|
|
||||||
'setup.cfg': jinja2.Template(setup_cfg_template),
|
|
||||||
})
|
|
||||||
|
|
||||||
self.template_context.update({
|
|
||||||
'setup_py_add': setup_py_add,
|
|
||||||
'setup_py_setup_args_add': setup_py_setup_args_add,
|
|
||||||
'setup_cfg_add': setup_cfg_add,
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user