[Checkins] SVN: zope.sqlalchemy/trunk/ Add support for running python setup.py test; simplify setup.py by using collective.checkdocs in the buildout

Laurence Rowe l at lrowe.co.uk
Mon Jun 7 10:27:52 EDT 2010


Log message for revision 113237:
  Add support for running python setup.py test; simplify setup.py by using collective.checkdocs in the buildout

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

-=-
Modified: zope.sqlalchemy/trunk/CHANGES.txt
===================================================================
--- zope.sqlalchemy/trunk/CHANGES.txt	2010-06-07 10:20:00 UTC (rev 113236)
+++ zope.sqlalchemy/trunk/CHANGES.txt	2010-06-07 14:27:51 UTC (rev 113237)
@@ -4,6 +4,8 @@
 0.5 (unreleased)
 ----------------
 
+* Add support for running ``python setup.py test``.
+
 * Pull in pysqlite explicitly as a test dependency.
 
 * Setup sqlalchemy mappers in test setup and clear them in tear down. This

Modified: zope.sqlalchemy/trunk/README.txt
===================================================================
--- zope.sqlalchemy/trunk/README.txt	2010-06-07 10:20:00 UTC (rev 113236)
+++ zope.sqlalchemy/trunk/README.txt	2010-06-07 14:27:51 UTC (rev 113237)
@@ -1 +1 @@
-Minimal Zope/SQLAlchemy transaction integration
\ No newline at end of file
+See src/zope/sqlalchemy/README.txt

Modified: zope.sqlalchemy/trunk/buildout.cfg
===================================================================
--- zope.sqlalchemy/trunk/buildout.cfg	2010-06-07 10:20:00 UTC (rev 113236)
+++ zope.sqlalchemy/trunk/buildout.cfg	2010-06-07 14:27:51 UTC (rev 113237)
@@ -6,8 +6,11 @@
 [test]
 recipe = zc.recipe.testrunner
 eggs = zope.sqlalchemy [test]
+defaults = ['--auto-color']
 
 [scripts]
 recipe = zc.recipe.egg
-eggs = ${test:eggs}
+eggs =
+    ${test:eggs}
+    collective.checkdocs
 interpreter = py

Modified: zope.sqlalchemy/trunk/setup.py
===================================================================
--- zope.sqlalchemy/trunk/setup.py	2010-06-07 10:20:00 UTC (rev 113236)
+++ zope.sqlalchemy/trunk/setup.py	2010-06-07 14:27:51 UTC (rev 113237)
@@ -1,73 +1,21 @@
-import os
+import os.path
 from setuptools import setup, find_packages
 
-# 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 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
-
 setup(
     name='zope.sqlalchemy',
     version='0.5dev', # Remember to update __version__ in __init__.py
-    
     packages=find_packages('src'),
     package_dir = {'':'src'},
     include_package_data=True,
     zip_safe=False,
-    
     namespace_packages=['zope'],
-    
+    test_suite='zope.sqlalchemy',
     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),
+    description="Minimal Zope/SQLAlchemy transaction integration",
+    long_description=open(os.path.join('src', 'zope', 'sqlalchemy', 'README.txt')).read() + "\n\n" +
+                     open('CHANGES.txt').read(),
     license='ZPL 2.1',
     keywords='zope zope3 sqlalchemy',                        
     classifiers=[
@@ -85,9 +33,7 @@
       ],
     extras_require={
         'test': [
-            'docutils',
             'pysqlite',
-            'zope.testing',
             ]
         },
     )



More information about the checkins mailing list