[Checkins] SVN: zc.resourcelibrary/trunk/ Whee, fixed up the package to work with the current KGS and be "modern".

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Nov 3 13:32:35 EDT 2007


Log message for revision 81436:
  Whee, fixed up the package to work with the current KGS and be "modern". 
  :-)
  

Changed:
  A   zc.resourcelibrary/trunk/CHANGES.txt
  A   zc.resourcelibrary/trunk/README.txt
  A   zc.resourcelibrary/trunk/bootstrap.py
  U   zc.resourcelibrary/trunk/buildout.cfg
  U   zc.resourcelibrary/trunk/setup.py
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt
  D   zc.resourcelibrary/trunk/src/zc/resourcelibrary/ftests/
  A   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml
  A   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/test_unit.py
  D   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests.py

-=-
Added: zc.resourcelibrary/trunk/CHANGES.txt
===================================================================
--- zc.resourcelibrary/trunk/CHANGES.txt	                        (rev 0)
+++ zc.resourcelibrary/trunk/CHANGES.txt	2007-11-03 17:32:35 UTC (rev 81436)
@@ -0,0 +1,32 @@
+=======
+CHANGES
+=======
+
+0.6.1 (2007-11-03)
+------------------
+
+- Update package meta-data.
+
+- Fixed package dependencies.
+
+- Merged functional and unit tests.
+
+0.6.0 (2006-09-22)
+------------------
+
+???
+
+0.5.2 (2006-06-15)
+------------------
+
+- Add more package meta-data.
+
+0.5.1 (2006-06-06)
+------------------
+
+- Update package code to work with newer versions of other packages.
+
+0.5.0 (2006-04-24)
+------------------
+
+- Initial release.


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

Added: zc.resourcelibrary/trunk/README.txt
===================================================================
--- zc.resourcelibrary/trunk/README.txt	                        (rev 0)
+++ zc.resourcelibrary/trunk/README.txt	2007-11-03 17:32:35 UTC (rev 81436)
@@ -0,0 +1,3 @@
+The resource library is a Zope 3 extension that is designed to make the
+inclusion of JavaScript, CSS, and other resources easy, cache-friendly,
+and component-friendly.


Property changes on: zc.resourcelibrary/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zc.resourcelibrary/trunk/bootstrap.py
===================================================================
--- zc.resourcelibrary/trunk/bootstrap.py	                        (rev 0)
+++ zc.resourcelibrary/trunk/bootstrap.py	2007-11-03 17:32:35 UTC (rev 81436)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                     ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+    cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, sys.executable,
+    '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)


Property changes on: zc.resourcelibrary/trunk/bootstrap.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: zc.resourcelibrary/trunk/buildout.cfg
===================================================================
--- zc.resourcelibrary/trunk/buildout.cfg	2007-11-03 17:06:22 UTC (rev 81435)
+++ zc.resourcelibrary/trunk/buildout.cfg	2007-11-03 17:32:35 UTC (rev 81436)
@@ -1,14 +1,7 @@
 [buildout]
 develop = .
-parts = zope3 test
+parts = test
 
-find-links = http://download.zope.org/distribution/
-
 [test]
 recipe = zc.recipe.testrunner
-eggs = zc.resourcelibrary
-extra-paths = parts/zope3/src
-
-[zope3]
-recipe = zc.recipe.zope3checkout
-url = svn://svn.zope.org/repos/main/Zope3/trunk
+eggs = zc.resourcelibrary [test]

Modified: zc.resourcelibrary/trunk/setup.py
===================================================================
--- zc.resourcelibrary/trunk/setup.py	2007-11-03 17:06:22 UTC (rev 81435)
+++ zc.resourcelibrary/trunk/setup.py	2007-11-03 17:32:35 UTC (rev 81436)
@@ -1,24 +1,80 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup for zc.resourcelibrary package
+
+$Id: setup.py 81038 2007-10-24 14:34:17Z srichter $
+"""
+import os
 from setuptools import setup, find_packages
 
-setup(
-    name="zc.resourcelibrary",
-    version="0.7dev",
-    packages=find_packages('src'),
-    
-    package_dir= {'':'src'},
-    
-    namespace_packages=['zc'],
-    include_package_data=True,
-    zip_safe=False,
-    author='Zope Project',
-    author_email='zope3-dev at zope.org',
-    description="""\
-The resource library is a Zope 3 extension that is designed to make the
-inclusion of JavaScript, CSS, and other resources easy, cache-friendly,
-and component-friendly.
-""",
-    license='ZPL',
-    keywords="zope zope3",
-    classifiers = ['Framework :: Zope3'],
-    install_requires=['setuptools'],    
-    )
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(name='zc.resourcelibrary',
+      version = '0.6.1',
+      author='Zope Corporation and Contributors',
+      author_email='zope3-dev at zope.org',
+      description='Post-rendering Resource Inclusion',
+      long_description=(
+          read('README.txt')
+          + '\n\n' +
+          'Detailed Dcoumentation\n' +
+          '======================\n'
+          + '\n\n' +
+          read('src', 'zc', 'resourcelibrary', 'README.txt')
+          + '\n\n' +
+          read('CHANGES.txt')
+          ),
+      keywords = "zope3 resource javascript css inclusion",
+      classifiers = [
+          'Development Status :: 5 - Production/Stable',
+          'Environment :: Web Environment',
+          'Intended Audience :: Developers',
+          'License :: OSI Approved :: Zope Public License',
+          'Programming Language :: Python',
+          'Natural Language :: English',
+          'Operating System :: OS Independent',
+          'Topic :: Internet :: WWW/HTTP',
+          'Framework :: Zope3'],
+      url='http://cheeseshop.python.org/pypi/zc.resourcelibrary',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'': 'src'},
+      namespace_packages=['zc'],
+      extras_require=dict(
+          test=['zope.app.authentication',
+                'zope.app.securitypolicy',
+                'zope.app.testing',
+                'zope.app.zcmlfiles',
+                'zope.pagetemplate',
+                'zope.securitypolicy',
+                'zope.testbrowser',
+                'zope.testing',
+                ]),
+      install_requires=['setuptools',
+                        'zope.app.component',
+                        'zope.app.publication',
+                        'zope.app.publisher',
+                        'zope.app.zapi',
+                        'zope.component',
+                        'zope.configuration',
+                        'zope.interface',
+                        'zope.publisher',
+                        'zope.security',
+                        'zope.tales',
+                        'zope.traversing',
+                        ],
+      include_package_data = True,
+      zip_safe = False,
+      )

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt	2007-11-03 17:06:22 UTC (rev 81435)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt	2007-11-03 17:32:35 UTC (rev 81436)
@@ -17,7 +17,7 @@
     ...     package="zc.resourcelibrary">
     ...
     ...   <resourceLibrary name="some-library">
-    ...     <directory source="ftests/example"/>
+    ...     <directory source="tests/example"/>
     ...   </resourceLibrary>
     ...
     ... </configure>
@@ -40,7 +40,7 @@
     ...
     ...   <resourceLibrary name="my-lib">
     ...     <directory
-    ...         source="ftests/example/my-lib"
+    ...         source="tests/example/my-lib"
     ...         include="included.js included.css"
     ...     />
     ...   </resourceLibrary>
@@ -58,7 +58,7 @@
     ...
     ...   <resourceLibrary name="bad-lib">
     ...     <directory
-    ...         source="ftests/example/my-lib"
+    ...         source="tests/example/my-lib"
     ...         include="included.bad"
     ...     />
     ...   </resourceLibrary>
@@ -178,7 +178,7 @@
     ...     package="zc.resourcelibrary">
     ...
     ...   <resourceLibrary name="dependent-but-unsatisfied" require="not-here">
-    ...     <directory source="ftests/example"/>
+    ...     <directory source="tests/example"/>
     ...   </resourceLibrary>
     ...
     ... </configure>
@@ -196,11 +196,11 @@
     ...     package="zc.resourcelibrary">
     ...
     ...   <resourceLibrary name="dependent" require="dependency">
-    ...     <directory source="ftests/example" include="1.js"/>
+    ...     <directory source="tests/example" include="1.js"/>
     ...   </resourceLibrary>
     ...
     ...   <resourceLibrary name="dependency">
-    ...     <directory source="ftests/example" include="2.css"/>
+    ...     <directory source="tests/example" include="2.css"/>
     ...   </resourceLibrary>
     ...
     ... </configure>

Copied: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests (from rev 81430, zc.resourcelibrary/trunk/src/zc/resourcelibrary/ftests)

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/ftests/ftesting.zcml	2007-11-03 06:24:29 UTC (rev 81430)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml	2007-11-03 17:32:35 UTC (rev 81436)
@@ -3,7 +3,7 @@
     xmlns:browser="http://namespaces.zope.org/browser"
     xmlns:zc="http://namespaces.zope.com/zc"
     i18n_domain="zope"
-    package="zc.resourcelibrary.ftests"
+    package="zc.resourcelibrary.tests"
     >
   <!-- set up enough of Zope to run the tests -->
 
@@ -20,13 +20,13 @@
   <include package="zope.app.securitypolicy" file="meta.zcml"/>
 
   <securityPolicy
-    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
 
   <role id="zope.Anonymous" title="Everybody"
-                 description="All users have this role implicitly" />
+        description="All users have this role implicitly" />
 
   <grant permission="zope.View"
-                  role="zope.Anonymous" />
+         role="zope.Anonymous" />
 
   <!-- also need the resource library config -->
 

Copied: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/test_unit.py (from rev 81430, zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests.py)
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/test_unit.py	                        (rev 0)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/test_unit.py	2007-11-03 17:32:35 UTC (rev 81436)
@@ -0,0 +1,75 @@
+import doctest
+import unittest
+from zope.testing.doctestunit import DocTestSuite
+
+from zc.resourcelibrary import resourcelibrary
+from zc.resourcelibrary.resourcelibrary import LibraryInfo
+
+
+def setUp(test):
+    test.old_library_info = resourcelibrary.library_info
+    resourcelibrary.library_info = library_info = {}
+    # Dependencies:
+    #
+    #  libA   libD
+    #     \    /
+    #    libB /
+    #       \/
+    #      libC
+    #
+    library_info['libA'] = LibraryInfo()
+    library_info['libA'].required.append('libB')
+    library_info['libB'] = LibraryInfo()
+    library_info['libB'].required.append('libC')
+    library_info['libC'] = LibraryInfo()
+    library_info['libD'] = LibraryInfo()
+    library_info['libD'].required.append('libC')
+
+
+def tearDown(test):
+    resourcelibrary.library_info = test.old_library_info
+
+
+def doctest_dependency_resolution():
+    """Test Response._addDependencies
+
+        >>> from zc.resourcelibrary.publication import Response
+        >>> r = Response()
+
+    The method gets a list of libraries and adds all their dependencies
+    in the proper order
+
+        >>> r._addDependencies(['libA'])
+        ['libC', 'libB', 'libA']
+
+    Here's a tricky corner case that the old algorithm used to get wrong:
+
+        >>> r._addDependencies(['libA', 'libD'])
+        ['libC', 'libB', 'libA', 'libD']
+
+    No library is included more than once
+
+        >>> r._addDependencies(['libC', 'libA', 'libD', 'libA'])
+        ['libC', 'libB', 'libA', 'libD']
+
+    Unknown library names cause errors
+
+        >>> r._addDependencies(['libA', 'libZ'])
+        Traceback (most recent call last):
+          ...
+        RuntimeError: Unknown resource library: "libZ"
+
+    """
+
+
+def test_suite():
+    return unittest.TestSuite(
+        (
+        DocTestSuite(setUp=setUp, tearDown=tearDown),
+        DocTestSuite('zc.resourcelibrary.publication',
+                     optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+                     ),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')

Deleted: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests.py	2007-11-03 17:06:22 UTC (rev 81435)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests.py	2007-11-03 17:32:35 UTC (rev 81436)
@@ -1,75 +0,0 @@
-import doctest
-import unittest
-from zope.testing.doctestunit import DocTestSuite
-
-from zc.resourcelibrary import resourcelibrary
-from zc.resourcelibrary.resourcelibrary import LibraryInfo
-
-
-def setUp(test):
-    test.old_library_info = resourcelibrary.library_info
-    resourcelibrary.library_info = library_info = {}
-    # Dependencies:
-    #
-    #  libA   libD
-    #     \    /
-    #    libB /
-    #       \/
-    #      libC
-    #
-    library_info['libA'] = LibraryInfo()
-    library_info['libA'].required.append('libB')
-    library_info['libB'] = LibraryInfo()
-    library_info['libB'].required.append('libC')
-    library_info['libC'] = LibraryInfo()
-    library_info['libD'] = LibraryInfo()
-    library_info['libD'].required.append('libC')
-
-
-def tearDown(test):
-    resourcelibrary.library_info = test.old_library_info
-
-
-def doctest_dependency_resolution():
-    """Test Response._addDependencies
-
-        >>> from zc.resourcelibrary.publication import Response
-        >>> r = Response()
-
-    The method gets a list of libraries and adds all their dependencies
-    in the proper order
-
-        >>> r._addDependencies(['libA'])
-        ['libC', 'libB', 'libA']
-
-    Here's a tricky corner case that the old algorithm used to get wrong:
-
-        >>> r._addDependencies(['libA', 'libD'])
-        ['libC', 'libB', 'libA', 'libD']
-
-    No library is included more than once
-
-        >>> r._addDependencies(['libC', 'libA', 'libD', 'libA'])
-        ['libC', 'libB', 'libA', 'libD']
-
-    Unknown library names cause errors
-
-        >>> r._addDependencies(['libA', 'libZ'])
-        Traceback (most recent call last):
-          ...
-        RuntimeError: Unknown resource library: "libZ"
-
-    """
-
-
-def test_suite():
-    return unittest.TestSuite(
-        (
-        DocTestSuite(setUp=setUp, tearDown=tearDown),
-        DocTestSuite('zc.resourcelibrary.publication',
-                     optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
-                     ),
-        ))
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')



More information about the Checkins mailing list