[Checkins] SVN: z3c.setuptools_mercurial/trunk/ - Feature: Make ``z3c.setuptools_mercurial`` compatible with Buildout

Stephan Richter srichter at gmail.com
Mon Aug 30 15:10:46 EDT 2010


Log message for revision 116038:
  - Feature: Make ``z3c.setuptools_mercurial`` compatible with Buildout 
  1.5,
    which does not include the standard PYTHONPATH by default anymore. 
  This
    caused mercurial not to find its library.
  
  - Feature: Use ``doctest`` instead of ``zope.testing.doctest``.
  
  - Feature: Update coverage setup.
  
  - Get ready for release.
  

Changed:
  U   z3c.setuptools_mercurial/trunk/CHANGES.txt
  U   z3c.setuptools_mercurial/trunk/buildout.cfg
  U   z3c.setuptools_mercurial/trunk/setup.py
  U   z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/finder.py
  U   z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/tests.py

-=-
Modified: z3c.setuptools_mercurial/trunk/CHANGES.txt
===================================================================
--- z3c.setuptools_mercurial/trunk/CHANGES.txt	2010-08-30 19:06:26 UTC (rev 116037)
+++ z3c.setuptools_mercurial/trunk/CHANGES.txt	2010-08-30 19:10:45 UTC (rev 116038)
@@ -2,11 +2,18 @@
 CHANGES
 =======
 
-1.0.2 (2009-??-??)
+1.1.0 (2010-08-30)
 ------------------
 
-- ...
+- Feature: Make ``z3c.setuptools_mercurial`` compatible with Buildout 1.5,
+  which does not include the standard PYTHONPATH by default anymore. This
+  caused mercurial not to find its library.
 
+- Feature: Use ``doctest`` instead of ``zope.testing.doctest``.
+
+- Feature: Update coverage setup.
+
+
 1.0.1 (2009-12-16)
 ------------------
 

Modified: z3c.setuptools_mercurial/trunk/buildout.cfg
===================================================================
--- z3c.setuptools_mercurial/trunk/buildout.cfg	2010-08-30 19:06:26 UTC (rev 116037)
+++ z3c.setuptools_mercurial/trunk/buildout.cfg	2010-08-30 19:10:45 UTC (rev 116038)
@@ -4,20 +4,23 @@
 
 [test]
 recipe = zc.recipe.testrunner
+include-site-packages = true
 eggs = z3c.setuptools_mercurial [test]
 
 [coverage-test]
 recipe = zc.recipe.testrunner
+include-site-packages = true
 eggs = z3c.setuptools_mercurial [test]
-defaults = ['--coverage', '../../coverage']
+defaults = ['--coverage', '${buildout:directory}/coverage']
 
 [coverage-report]
 recipe = zc.recipe.egg
 eggs = z3c.coverage
-scripts = coverage=coverage-report
-arguments = ('coverage', 'coverage/report')
+scripts = coveragereport=coverage-report
+arguments = ('coverage', '${buildout:directory}/coverage/report')
 
 [python]
 recipe = zc.recipe.egg
+include-site-packages = true
 eggs = z3c.setuptools_mercurial
 interpreter = py

Modified: z3c.setuptools_mercurial/trunk/setup.py
===================================================================
--- z3c.setuptools_mercurial/trunk/setup.py	2010-08-30 19:06:26 UTC (rev 116037)
+++ z3c.setuptools_mercurial/trunk/setup.py	2010-08-30 19:10:45 UTC (rev 116038)
@@ -23,7 +23,7 @@
 
 setup (
     name='z3c.setuptools_mercurial',
-    version='1.0.2dev',
+    version='1.1.0',
     author = "Stephan Richter and the Zope Community",
     author_email = "zope-dev at zope.org",
     description = "Mercurial File Finder Plugin for Setuptools",
@@ -55,8 +55,7 @@
     package_dir = {'':'src'},
     namespace_packages = ['z3c'],
     extras_require = dict(
-        test = [
-            'zope.testing',],
+        test = [],
         ),
     install_requires = [
         'setuptools',

Modified: z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/finder.py
===================================================================
--- z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/finder.py	2010-08-30 19:06:26 UTC (rev 116037)
+++ z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/finder.py	2010-08-30 19:10:45 UTC (rev 116038)
@@ -12,16 +12,20 @@
 #
 ##############################################################################
 """Find all files checked into a mercurial repository.
-
-$Id$
 """
 import logging
+import os
 import os.path
 import subprocess
 
 def find_files(dirname="."):
     """Find all files checked into a mercurial repository."""
     dirname = os.path.abspath(dirname)
+    # Support for zc.buildout 1.5 and higher.
+    python_path = None
+    if 'BUILDOUT_ORIGINAL_PYTHONPATH' in os.environ:
+        python_path = os.environ['PYTHONPATH']
+        os.environ['PYTHONPATH'] = os.environ['BUILDOUT_ORIGINAL_PYTHONPATH']
     try:
         # List all files of the repository as absolute paths.
         proc = subprocess.Popen(['hg', 'locate', '-f'],
@@ -31,8 +35,14 @@
         stdout, stderr = proc.communicate()
     except Exception, err:
         logging.error(str(err))
+        if python_path:
+            os.environ['PYTHONPATH'] = python_path
         # If anything happens, return an empty list.
         return []
+
+    if python_path:
+        os.environ['PYTHONPATH'] = python_path
+
     # The process finished, but returned an error code.
     if proc.returncode != 0:
         logging.error(stderr+ ' (code %i)' %proc.returncode)

Modified: z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/tests.py
===================================================================
--- z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/tests.py	2010-08-30 19:06:26 UTC (rev 116037)
+++ z3c.setuptools_mercurial/trunk/src/z3c/setuptools_mercurial/tests.py	2010-08-30 19:10:45 UTC (rev 116038)
@@ -18,8 +18,7 @@
 import logging
 import os
 import unittest
-from zope.testing import doctest
-from zope.testing.doctestunit import DocFileSuite
+import doctest
 
 class TestingHandler(logging.Handler):
 
@@ -39,7 +38,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        DocFileSuite(
+        doctest.DocFileSuite(
             'README.txt',
             globs={'cmd': do_cmd},
             setUp=setUp, tearDown=tearDown,



More information about the checkins mailing list