diff options
author | Devaev Maxim <[email protected]> | 2019-04-28 22:56:07 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-04-28 22:56:07 +0300 |
commit | d0df1ba91a24e3e00b76a8ebe3a54d292ee824a4 (patch) | |
tree | 8317129f0c163e784ba7950cbfe1c04d66015602 /setup.py | |
parent | 6857fcf2570591a58c6b11ce6e0324ee7d98152b (diff) |
fixed template
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -30,12 +30,32 @@ from setuptools.command.easy_install import ScriptWriter # ===== def main() -> None: + def get_args(cls, dist, header=None): # type: ignore + if header is None: + header = cls.get_header() + + spec = str(dist.as_requirement()) + for group_type in ["console", "gui"]: + group = group_type + "_scripts" + for (name, ep) in dist.get_entry_map(group).items(): + cls._ensure_safe_name(name) + script_text = cls.template.format( + spec=spec, + group=group, + name=name, + module=ep.module_name, + ) + args = cls._get_script_args(group_type, name, header, script_text) + for res in args: + yield res + + ScriptWriter.get_args = classmethod(get_args) ScriptWriter.template = textwrap.dedent(""" - # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r + # EASY-INSTALL-ENTRY-SCRIPT: {spec},{group},{name} - __requires__ = %(spec)r + __requires__ = "{spec}" - from kvmd.apps.%(name)r import main + from {module} import main if __name__ == "__main__": main() |