[Checkins] SVN: zc.customdoctests/trunk/ Add Python 3 compatiblity.

Stephen Richter cvs-admin at zope.org
Wed Feb 13 17:15:01 UTC 2013


Log message for revision 129345:
  Add Python 3 compatiblity.
  

Changed:
  _U  zc.customdoctests/trunk/
  A   zc.customdoctests/trunk/CHANGES.txt
  A   zc.customdoctests/trunk/MANIFEST.in
  U   zc.customdoctests/trunk/README.txt
  U   zc.customdoctests/trunk/buildout.cfg
  U   zc.customdoctests/trunk/setup.py
  _U  zc.customdoctests/trunk/src/
  U   zc.customdoctests/trunk/src/zc/customdoctests/__init__.py
  U   zc.customdoctests/trunk/src/zc/customdoctests/js.py
  A   zc.customdoctests/trunk/tox.ini

-=-

Property changes on: zc.customdoctests/trunk
___________________________________________________________________
Modified: svn:ignore
   - develop-eggs
bin
parts

   + .coverage
.installed.cfg
.tox
bin
coverage
develop-eggs
dist
parts
*.xml


Added: zc.customdoctests/trunk/CHANGES.txt
===================================================================
--- zc.customdoctests/trunk/CHANGES.txt	                        (rev 0)
+++ zc.customdoctests/trunk/CHANGES.txt	2013-02-13 17:15:00 UTC (rev 129345)
@@ -0,0 +1,16 @@
+=======
+CHANGES
+=======
+
+1.0.0 (unreleased)
+------------------
+
+- Added Python 3.3 support.
+
+- Cleanup `setup.py`, add `tox.ini` and manifest.
+
+
+0.1.0 (2011-05-19)
+------------------
+
+- Initial release


Property changes on: zc.customdoctests/trunk/CHANGES.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Added: zc.customdoctests/trunk/MANIFEST.in
===================================================================
--- zc.customdoctests/trunk/MANIFEST.in	                        (rev 0)
+++ zc.customdoctests/trunk/MANIFEST.in	2013-02-13 17:15:00 UTC (rev 129345)
@@ -0,0 +1,9 @@
+include *.rst
+include *.txt
+include tox.ini
+include bootstrap.py
+include buildout.cfg
+
+recursive-include src *
+
+global-exclude *.pyc

Modified: zc.customdoctests/trunk/README.txt
===================================================================
--- zc.customdoctests/trunk/README.txt	2013-02-13 17:00:25 UTC (rev 129344)
+++ zc.customdoctests/trunk/README.txt	2013-02-13 17:15:00 UTC (rev 129345)
@@ -1,8 +1,9 @@
+=====================================================
 zc.customdoctests -- Use doctest with other languages
-*****************************************************
+=====================================================
 
 doctest (and recently manuel) provide hooks for using custom doctest
-parsers.  zc.customdoctests helps to leverage this to support other
+parsers.  `zc.customdoctests` helps to leverage this to support other
 languages, such as JavaScript::
 
     js> function double (x) {
@@ -16,11 +17,3 @@
 JavaScript, and sh.
 
 .. contents::
-
-Changes
-*******
-
-0.1.0 (2011-05-19)
-==================
-
-Initial release

Modified: zc.customdoctests/trunk/buildout.cfg
===================================================================
--- zc.customdoctests/trunk/buildout.cfg	2013-02-13 17:00:25 UTC (rev 129344)
+++ zc.customdoctests/trunk/buildout.cfg	2013-02-13 17:15:00 UTC (rev 129345)
@@ -1,9 +1,14 @@
 [buildout]
 develop = .
-parts = test py
+parts = test test3 py
 
 [test]
 recipe = zc.recipe.testrunner
+eggs = zc.customdoctests [test,js]
+
+[test3]
+# python-spidermonkey does not run on Python 3 yet.
+recipe = zc.recipe.testrunner
 eggs = zc.customdoctests [test]
 
 [py]

Modified: zc.customdoctests/trunk/setup.py
===================================================================
--- zc.customdoctests/trunk/setup.py	2013-02-13 17:00:25 UTC (rev 129344)
+++ zc.customdoctests/trunk/setup.py	2013-02-13 17:15:00 UTC (rev 129345)
@@ -11,24 +11,44 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-name, version = 'zc.customdoctests', '0'
+import os
+from setuptools import setup, find_packages
 
 install_requires = ['setuptools']
-extras_require = dict(test=['zope.testing', 'python-spidermonkey', 'manuel'])
+extras_require = dict(
+    test=['zope.testing', 'manuel'],
+    js=['python-spidermonkey'],
+    )
 
-from setuptools import setup
-import os
-
 setup(
+    name = 'zc.customdoctests',
+    version = '1.0.0dev',
+    url='http://pypi.python.org/pypi/zc.customdoctests',
+    license = 'ZPL 2.1',
+    description = open('README.txt').read().strip().split('\n')[0],
     author = 'Jim Fulton',
     author_email = 'jim at zope.com',
-    license = 'ZPL 2.1',
-
-    name = name, version = version,
+    classifiers=[
+        'Development Status :: 4 - Beta',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Software Development',
+        ],
     long_description=(
         open('README.txt').read() + '\n\n' +
+        open('CHANGES.txt').read() + '\n\n' +
+        '======================\n' +
         'Detailed dcoumentation\n' +
-        '**********************\n\n' +
+        '======================\n\n' +
         open(os.path.join(os.path.dirname(__file__),
                           'src', 'zc', 'customdoctests', 'README.txt')
              ).read() + '\n\n' +
@@ -36,14 +56,13 @@
                           'src', 'zc', 'customdoctests', 'spidermonkey.txt')
              ).read()
         ),
-    description = open('README.txt').read().strip().split('\n')[0],
-    packages = [name.split('.')[0], name],
-    namespace_packages = [name.split('.')[0]],
+    packages=find_packages('src'),
     package_dir = {'': 'src'},
+    namespace_packages = ['zc',],
     install_requires = install_requires,
-    zip_safe = False,
-    package_data = {name: ['*.txt', '*.test', '*.html']},
+    package_data = {'zc.customdoctests': ['*.txt']},
     extras_require = extras_require,
     tests_require = extras_require['test'],
-    test_suite = name+'.tests.test_suite',
+    test_suite = 'zc.customdoctests.tests.test_suite',
+    zip_safe = False,
     )


Property changes on: zc.customdoctests/trunk/src
___________________________________________________________________
Added: svn:ignore
   + *.egg-info


Modified: zc.customdoctests/trunk/src/zc/customdoctests/__init__.py
===================================================================
--- zc.customdoctests/trunk/src/zc/customdoctests/__init__.py	2013-02-13 17:00:25 UTC (rev 129344)
+++ zc.customdoctests/trunk/src/zc/customdoctests/__init__.py	2013-02-13 17:15:00 UTC (rev 129345)
@@ -11,7 +11,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-
 import doctest
 import re
 import sys
@@ -23,8 +22,12 @@
         ps1 = kw.pop('ps1', '>>>')
         comment_prefix = kw.pop('comment_prefix', '#')
         self.transform = kw.pop('transform', lambda s: s)
-        getattr(doctest.DocTestParser, '__init__', lambda : None)(*args, **kw)
-
+        try:
+            getattr(
+                doctest.DocTestParser, '__init__', lambda : None)(*args, **kw)
+        except TypeError:
+            # Python 3 support.
+            super(doctest.DocTestParser, self).__init__(*args, **kw)
         self._EXAMPLE_RE = re.compile(
             r'''
             # Source consists of a PS1 line followed by zero or more PS2 lines.

Modified: zc.customdoctests/trunk/src/zc/customdoctests/js.py
===================================================================
--- zc.customdoctests/trunk/src/zc/customdoctests/js.py	2013-02-13 17:00:25 UTC (rev 129344)
+++ zc.customdoctests/trunk/src/zc/customdoctests/js.py	2013-02-13 17:15:00 UTC (rev 129345)
@@ -11,7 +11,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-
 import doctest
 import os
 import re

Added: zc.customdoctests/trunk/tox.ini
===================================================================
--- zc.customdoctests/trunk/tox.ini	                        (rev 0)
+++ zc.customdoctests/trunk/tox.ini	2013-02-13 17:15:00 UTC (rev 129345)
@@ -0,0 +1,26 @@
+[tox]
+envlist = py26,py27,py33
+
+[testenv]
+commands =
+    python setup.py test -q
+# without explicit deps, setup.py test will download a bunch of eggs into $PWD
+deps =
+     manuel
+     zope.testrunner
+     zope.testing
+
+[testenv:coverage]
+basepython =
+    python2.7
+commands =
+#   The installed version messes up nose's test discovery / coverage reporting
+#   So, we uninstall that from the environment, and then install the editable
+#   version, before running nosetests.
+    pip uninstall -y zc.customdoctests
+    pip install -e .
+    nosetests --with-xunit --with-xcoverage
+deps =
+    nose
+    coverage
+    nosexcover



More information about the checkins mailing list