Improved template handling

This commit is contained in:
2021-03-10 08:09:56 +01:00
parent 31515d2c3a
commit f4ca76d844
11 changed files with 201 additions and 86 deletions

View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
"""
sh_cpl sh-edraft Common Python library
~~~~~~~~~~~~~~~~~~~
sh-edraft Common Python library
:copyright: (c) 2020 - 2021 sh-edraft.de
:license: MIT, see LICENSE for more details.
"""
__title__ = 'cpl_cli.templates.publish'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
__version__ = '2021.4.1'
from collections import namedtuple
# imports:
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major=2021, minor=4, micro=1)

View File

@@ -0,0 +1,31 @@
from cpl_cli.templates.template import Template
class Setup:
@staticmethod
def get_setup_py() -> str:
string = """\"\"\"
This file is generated by CPL CLI
\"\"\"
import setuptools
setuptools.setup(
name='$Name',
version='$Version',
packages=$Packages,
url='$URL',
license='$LicenseName',
author='$Author',
author_email='$AuthorMail',
include_package_data=$IncludePackageData,
description='$Description',
python_requires='$PyRequires',
install_requires=$Dependencies,
entry_points=$EntryPoints,
package_data=$PackageData
)
"""
return Template.build_template_string(string)

View File

@@ -1,21 +0,0 @@
"""
This file is generated by CPL CLI
"""
import setuptools
setuptools.setup(
name='$Name',
version='$Version',
packages=$Packages,
url='$URL',
license='$LicenseName',
author='$Author',
author_email='$AuthorMail',
include_package_data=$IncludePackageData,
description='$Description',
python_requires='$PyRequires',
install_requires=$Dependencies,
entry_points=$EntryPoints,
package_data=$PackageData
)