summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-28 22:05:52 +0300
committerDevaev Maxim <[email protected]>2019-04-28 22:05:52 +0300
commit47641bf914c809f3c575d2caf071132008e19587 (patch)
tree5209b30137b67a4c899ff723572cc79ce8a96846 /setup.py
parente13b5027d6093cbacccf49e9af9c46c0dc1ef374 (diff)
fast entrypoints
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 42cc6586..f380d85b 100755
--- a/setup.py
+++ b/setup.py
@@ -21,11 +21,26 @@
# ========================================================================== #
+import os
+import textwrap
+
from setuptools import setup
+from setuptools.command.easy_install import ScriptWriter
# =====
def main() -> None:
+ ScriptWriter.template = textwrap.dedent("""
+ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
+
+ __requires__ = %(spec)r
+
+ from kvmd.apps.%(name)r import main
+
+ if __name__ == "__main__":
+ main()
+ """).strip()
+
setup(
name="kvmd",
version="0.158",
@@ -53,6 +68,12 @@ def main() -> None:
"kvmd": ["data/*.yaml"],
},
+ scripts=[
+ os.path.join("scripts", name)
+ for name in os.listdir("scripts")
+ if not name.startswith(".")
+ ],
+
entry_points={
"console_scripts": [
"kvmd = kvmd.apps.kvmd:main",