Package the daemon executable as an entrypoint
authorJeremy Stanley <fungi@yuggoth.org>
Thu, 15 Dec 2016 06:17:09 +0000 (06:17 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Thu, 15 Dec 2016 06:17:09 +0000 (06:17 +0000)
Move the daemon executable into the Python package and define an
entrypoint for it in setup.cfg so a similar `mudpy` executable will
still be installed. Drop the unnecessary import path override now
while at it.

mudpy/daemon.py [moved from bin/mudpy with 88% similarity]
setup.cfg

similarity index 88%
rename from bin/mudpy
rename to mudpy/daemon.py
index d7ec045..2413204 100755 (executable)
--- a/bin/mudpy
@@ -1,15 +1,10 @@
-#!/usr/bin/env python3
-"""Skeletal executable for the mudpy engine."""
-
 # Copyright (c) 2004-2016 Jeremy Stanley <fungi@yuggoth.org>. Permission
 # to use, copy, modify, and distribute this software is granted under
 # terms provided in the LICENSE file distributed with this software.
 
 # core objects for the mudpy engine
 import imp
-import os
 import sys
-sys.path.append(os.path.realpath("."))
 
 import mudpy
 
index c1e4624..35cd6bc 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -28,3 +28,7 @@ classifier =
 [files]
 packages =
     mudpy
+
+[entry_points]
+console_scripts =
+    mudpy = mudpy.daemon:main