Commits

Thomas Perl  committed df2194f

Move metadata to python package (for pydoc, etc..)

  • Participants
  • Parent commits 435034a

Comments (0)

Files changed (4)

 that need installing. The script is made so that it also can be run from
 source (or installed system-wide).
 
+Goals:
+
+  1. Only set one value in setup.py (PACKAGE_NAME), rest is automatic
+  2. Metadata only defined in one place (lib/<PACKAGE_NAME>/__init__.py)
+  3. Known-good module documentation (PYTHONPATH=lib pydoc <PACKAGE_NAME>)
+  4. Runnable from a source checkout or from system-wide installation
+
+
 http://bitbucket.org/pyugat/mini-setup-py
 
 # Blubb - A boring example project
 #
 
-"""Single line overview what Blubb does
-
-Longer description of what Blubb does. This can range from a single
-sentence to multiple paragraphs. Don't be afraid to go into detail.
-"""
-
 PACKAGE_NAME = 'blubb'
 
-__author__ = 'Firstname Lastname <firstname.lastname@example.org>'
-__license__ = 'BSD (for example)'
-__url__ = 'http://bitbucket.org/pyugat/mini-setup-py'
-__version__ = '1.0.0'
-
 import sys
 import os.path
 

File lib/blubb/__init__.py

+# -*- coding: utf-8 -*-
+
+"""Single line overview what Blubb does
+
+Longer description of what Blubb does. This can range from a single
+sentence to multiple paragraphs. Don't be afraid to go into detail.
+"""
+
+__author__ = 'Firstname Lastname <firstname.lastname@example.org>'
+__license__ = 'BSD (for example)'
+__url__ = 'http://bitbucket.org/pyugat/mini-setup-py'
+__version__ = '1.0.0'
+
 import os
 import re
 
-main_py = open(PACKAGE_NAME).read()
+main_py = open('lib/%s/__init__.py' % PACKAGE_NAME).read()
 m = dict(re.findall("\n__([a-z]+)__ = '([^']+)'", main_py))
 docs = re.findall('"""(.*?)"""', main_py, re.DOTALL)