[Checkins] SVN: zope.sqlalchemy/trunk/ fix documentation (steal setup.py features from Gary)

Laurence Rowe l at lrowe.co.uk
Sat Jun 28 10:34:32 EDT 2008


Log message for revision 87844:
  fix documentation (steal setup.py features from Gary)

Changed:
  U   zope.sqlalchemy/trunk/CHANGES.txt
  U   zope.sqlalchemy/trunk/README.txt
  U   zope.sqlalchemy/trunk/setup.py
  U   zope.sqlalchemy/trunk/src/zope/sqlalchemy/README.txt

-=-
Modified: zope.sqlalchemy/trunk/CHANGES.txt
===================================================================
--- zope.sqlalchemy/trunk/CHANGES.txt	2008-06-28 13:53:32 UTC (rev 87843)
+++ zope.sqlalchemy/trunk/CHANGES.txt	2008-06-28 14:34:30 UTC (rev 87844)
@@ -1,15 +1,15 @@
-zope.sqlalchemy changes
-***********************
+Changes
+=======
 
 0.2 (2008-06-28)
-================
+----------------
 
 Feature changes
----------------
+~~~~~~~~~~~~~~~
 
 * Updated to support SQLAlchemy 0.5. (0.4.6 is still supported).
 
 0.1 (2008-05-15)
-================
+----------------
 
 Initial public release.

Modified: zope.sqlalchemy/trunk/README.txt
===================================================================
--- zope.sqlalchemy/trunk/README.txt	2008-06-28 13:53:32 UTC (rev 87843)
+++ zope.sqlalchemy/trunk/README.txt	2008-06-28 14:34:30 UTC (rev 87844)
@@ -1,3 +1 @@
-***************
-zope.sqlalchemy
-***************
+Minimal Zope/SQLAlchemy transaction integration
\ No newline at end of file

Modified: zope.sqlalchemy/trunk/setup.py
===================================================================
--- zope.sqlalchemy/trunk/setup.py	2008-06-28 13:53:32 UTC (rev 87843)
+++ zope.sqlalchemy/trunk/setup.py	2008-06-28 14:34:30 UTC (rev 87844)
@@ -1,54 +1,92 @@
+import os
 from setuptools import setup, find_packages
-import sys, os
 
-def read(*rnames):
-    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+# generic helpers primarily for the long_description
+try:
+    import docutils
+except ImportError:
+    import warnings
+    def validateReST(text):
+        return ''
+else:
+    import docutils.utils
+    import docutils.parsers.rst
+    import StringIO
+    def validateReST(text):
+        doc = docutils.utils.new_document('validator')
+        # our desired settings
+        doc.reporter.halt_level = 5
+        doc.reporter.report_level = 1
+        stream = doc.reporter.stream = StringIO.StringIO()
+        # docutils buglets (?)
+        doc.settings.tab_width = 2
+        doc.settings.pep_references = doc.settings.rfc_references = False
+        doc.settings.trim_footnote_reference_space = None
+        # and we're off...
+        parser = docutils.parsers.rst.Parser()
+        parser.parse(text, doc)
+        return stream.getvalue()
 
-def desc(*texts):
-    return '\n'.join(texts)
+def text(*args, **kwargs):
+    # note: distutils explicitly disallows unicode for setup values :-/
+    # http://docs.python.org/dist/meta-data.html
+    tmp = []
+    for a in args:
+        if a.endswith('.txt'):
+            f = open(os.path.join(*a.split('/')))
+            tmp.append(f.read())
+            f.close()
+            tmp.append('\n\n')
+        else:
+            tmp.append(a)
+    if len(tmp) == 1:
+        res = tmp[0]
+    else:
+        res = ''.join(tmp)
+    report = validateReST(res)
+    if report:
+        print report
+        raise ValueError('ReST validation error')
+    return res
+# end helpers; below this line should be code custom to this package
 
-SVN_VERSION = "`SVN version <svn://svn.zope.org/repos/main/zope.sqlalchemy/trunk#egg=zope.sqlalchemy-dev>`_\n"
+setup(
+    name='zope.sqlalchemy',
+    version='0.2', # Remember to update __version__ in __init__.py
+    
+    packages=find_packages('src'),
+    package_dir = {'':'src'},
+    include_package_data=True,
+    zip_safe=False,
+    
+    namespace_packages=['zope'],
+    
+    author='Laurence Rowe',
+    author_email='laurence at lrowe.co.uk',
+    url='http://pypi.python.org/pypi/zope.sqlalchemy',
+    description=text('README.txt'),
+    long_description=text('src/zope/sqlalchemy/README.txt',
+                          'CHANGES.txt',
+                          out=True),
+    license='ZPL 2.1',
+    keywords='zope zope3 sqlalchemy',                        
+    classifiers=[
+    "Framework :: Zope3",
+    "Programming Language :: Python",
+    "License :: OSI Approved :: Zope Public License",
+    "Topic :: Software Development :: Libraries :: Python Modules",
+    ],
 
-long_description = desc(
-    read('README.txt'),
-    read('src', 'zope', 'sqlalchemy', 'README.txt'),
-    SVN_VERSION,
-    read('CHANGES.txt'),
-    'Download\n********\n',
+    install_requires=[
+      'setuptools',
+      'SQLAlchemy>=0.4.6',
+      'transaction',
+      'zope.interface',
+      ],
+    extras_require={
+        'test': [
+            'zope.testing',
+            'docutils',
+            ]
+        },
     )
-
-setup(name='zope.sqlalchemy',
-      version='0.2', # Remember to update __version__ in __init__.py
-      description="Minimal Zope/SQLAlchemy transaction integration",
-      long_description=long_description,
-      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
-      classifiers=[
-        "Framework :: Zope3",
-        "Programming Language :: Python",
-        "License :: OSI Approved :: Zope Public License",
-        "Topic :: Software Development :: Libraries :: Python Modules",
-        ],
-      keywords='',
-      author='Laurence Rowe',
-      author_email='laurence at lrowe.co.uk',
-      url='http://pypi.python.org/pypi/zope.sqlalchemy',
-      license='ZPL 2.1',
-      packages=find_packages('src'),
-      package_dir = {'':'src'},
-      namespace_packages=['zope'],
-      include_package_data=True,
-      zip_safe=False,
-      install_requires=[
-          # -*- Extra requirements: -*-
-          'setuptools',
-          'SQLAlchemy>=0.4.6',
-          'transaction',
-          'zope.interface',
-      ],
-      entry_points="""
-      # -*- Entry points: -*-
-      """,
-      extras_require = dict(
-              test = ['zope.testing'],
-              ),
-      )

Modified: zope.sqlalchemy/trunk/src/zope/sqlalchemy/README.txt
===================================================================
--- zope.sqlalchemy/trunk/src/zope/sqlalchemy/README.txt	2008-06-28 13:53:32 UTC (rev 87843)
+++ zope.sqlalchemy/trunk/src/zope/sqlalchemy/README.txt	2008-06-28 14:34:30 UTC (rev 87844)
@@ -1,6 +1,10 @@
+***************
 zope.sqlalchemy
 ***************
 
+.. contents::
+   :local:
+
 Introduction
 ============
 
@@ -161,3 +165,9 @@
     >>> session.query(User).all()[0].name
     u'bob'
     >>> transaction.abort()
+
+Development version
+===================
+
+`SVN version <svn://svn.zope.org/repos/main/zope.sqlalchemy/trunk#egg=zope.sqlalchemy-dev>`_
+



More information about the Checkins mailing list