Browse Source

proper packaging

boyska 4 years ago
parent
commit
5b0129e569
4 changed files with 34 additions and 1 deletions
  1. 2 0
      .gitignore
  2. 2 0
      server/__init__.py
  3. 3 1
      server/cli.py
  4. 27 0
      setup.py

+ 2 - 0
.gitignore

@@ -1,3 +1,5 @@
 *.swp
 *.pyc
 *~
+build/
+dist/

+ 2 - 0
server/__init__.py

@@ -0,0 +1,2 @@
+import server
+import cli

+ 3 - 1
server/cli.py

@@ -81,7 +81,7 @@ def common_pre():
         for warn in check():
             logger.warn(warn)
 
-if __name__ == "__main__":
+def main():
     parser = ArgumentParser(description='creates mp3 from live recordings')
     parser.add_argument('--verbose', '-v', action='count',
                         help='Increase verbosity; can be used multiple times')
@@ -122,3 +122,5 @@ if __name__ == "__main__":
             logging.info("giving verbose flag >2 times is useless")
     common_pre()
     options.func(options)
+if __name__ == "__main__":
+    main()

+ 27 - 0
setup.py

@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+from setuptools import setup
+
+requires = [
+    line.strip()
+    for line in open("server/requirements.txt").read().split("\n")
+    if line.strip()
+]
+setup(
+    name="techrec",
+    version="1.1",
+    description="A Python2 web application "
+    "that assist radio speakers in recording their shows",
+    long_description=open("README.md").read(),
+    long_description_content_type="text/markdown",
+    author="boyska",
+    author_email="piuttosto@logorroici.org",
+    packages=["techrec"],
+    package_dir={"techrec": "server"},
+    install_requires=requires,
+    entry_points={
+        "console_scripts": [
+            "techrec = techrec.cli:main",
+        ]
+    },
+)