[Checkins] SVN: zope.mimetype/trunk/ Make a real package and make functional tests working.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Nov 1 23:06:49 EDT 2007


Log message for revision 81398:
  Make a real package and make functional tests working.
  

Changed:
  _U  zope.mimetype/trunk/
  A   zope.mimetype/trunk/CHANGES.txt
  A   zope.mimetype/trunk/README.txt
  A   zope.mimetype/trunk/bootstrap.py
  A   zope.mimetype/trunk/buildout.cfg
  U   zope.mimetype/trunk/setup.py
  A   zope.mimetype/trunk/src/zope/mimetype/ftesting.zcml
  A   zope.mimetype/trunk/src/zope/mimetype/testing.py
  U   zope.mimetype/trunk/src/zope/mimetype/tests.py

-=-

Property changes on: zope.mimetype/trunk
___________________________________________________________________
Name: svn:ignore
   + .installed.cfg
bin
develop-eggs
dist
parts


Added: zope.mimetype/trunk/CHANGES.txt
===================================================================
--- zope.mimetype/trunk/CHANGES.txt	                        (rev 0)
+++ zope.mimetype/trunk/CHANGES.txt	2007-11-02 03:06:49 UTC (rev 81398)
@@ -0,0 +1,15 @@
+=======
+CHANGES
+=======
+
+1.1.0 (2007-11-01)
+------------------
+
+- Package data update.
+
+- First public release.
+
+1.0.0 (2007-??-??)
+------------------
+
+- Initial release.


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

Added: zope.mimetype/trunk/README.txt
===================================================================
--- zope.mimetype/trunk/README.txt	                        (rev 0)
+++ zope.mimetype/trunk/README.txt	2007-11-02 03:06:49 UTC (rev 81398)
@@ -0,0 +1,3 @@
+This package provides a way to work with MIME content types.  There
+are several interfaces defined here, many of which are used primarily
+to look things up based on different bits of information.


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

Added: zope.mimetype/trunk/bootstrap.py
===================================================================
--- zope.mimetype/trunk/bootstrap.py	                        (rev 0)
+++ zope.mimetype/trunk/bootstrap.py	2007-11-02 03:06:49 UTC (rev 81398)
@@ -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: zope.mimetype/trunk/bootstrap.py
___________________________________________________________________
Name: svn:keywords
   + Id

Added: zope.mimetype/trunk/buildout.cfg
===================================================================
--- zope.mimetype/trunk/buildout.cfg	                        (rev 0)
+++ zope.mimetype/trunk/buildout.cfg	2007-11-02 03:06:49 UTC (rev 81398)
@@ -0,0 +1,8 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zope.mimetype [test]
+

Modified: zope.mimetype/trunk/setup.py
===================================================================
--- zope.mimetype/trunk/setup.py	2007-11-02 03:02:14 UTC (rev 81397)
+++ zope.mimetype/trunk/setup.py	2007-11-02 03:06:49 UTC (rev 81398)
@@ -1,3 +1,20 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""Setup for zope.mimetype package
+
+$Id$
+"""
 import os
 from setuptools import setup, find_packages
 
@@ -4,21 +21,66 @@
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
-name = "zope.mimetype"
-setup(
-    name = name,
-    version = "1.1dev",
-    author = "the Zope 3 project",
-    author_email = "zope3-dev at zope.org",
-    description = "A simple package for working with MIME content types",
-    long_description=read('src', 'zope', 'mimetype', 'README.txt'),
-    license = "ZPL 2.1",
-    keywords = "MIME content type",
-    url='http://svn.zope.org/zope.mimetype',
-
-    packages = ['zope', 'zope.mimetype'],
-    package_dir = {'': 'src'},
-    namespace_packages = ['zope'],
-    install_requires = ['setuptools'],
-    include_package_data = True,
-    )
+setup(name='zope.mimetype',
+      version = '0.3.0',
+      author='Zope Corporation and Contributors',
+      author_email='zope3-dev at zope.org',
+      description = "A simple package for working with MIME content types",
+      long_description=(
+          read('README.txt')
+          + '\n\n' +
+          'Detailed Documentation\n' +
+          '======================\n\n'
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'README.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'retrieving_mime_types.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'codec.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'constraints.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'contentinfo.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'event.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'typegetter.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'source.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'widget.txt')
+          + '\n\n' +
+          read('src', 'zope', 'mimetype', 'utils.txt')
+          + '\n\n' +
+          read('CHANGES.txt')
+          ),
+      keywords = "file content mimetype",
+      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/zope.mimetype',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'': 'src'},
+      namespace_packages=['zope'],
+      extras_require = dict(
+          test=['zope.app.securitypolicy',
+                'zope.app.testing',
+                'zope.app.zcmlfiles',
+                'zope.securitypolicy',
+                ]),
+      install_requires=['setuptools',
+                        'zope.component',
+                        'zope.configuration',
+                        'zope.interface',
+                        ],
+      include_package_data = True,
+      zip_safe = False,
+      )

Added: zope.mimetype/trunk/src/zope/mimetype/ftesting.zcml
===================================================================
--- zope.mimetype/trunk/src/zope/mimetype/ftesting.zcml	                        (rev 0)
+++ zope.mimetype/trunk/src/zope/mimetype/ftesting.zcml	2007-11-02 03:06:49 UTC (rev 81398)
@@ -0,0 +1,44 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:zcml="http://namespaces.zope.org/zcml"
+    i18n_domain="zc.catalog"
+    >
+
+  <include
+      zcml:condition="installed zope.app.zcmlfiles"
+      package="zope.app.zcmlfiles"
+      />
+  <include
+      zcml:condition="not-installed zope.app.zcmlfiles"
+      package="zope.app"
+      />
+  <include package="zope.mimetype" file="meta.zcml"/>
+  <include package="zope.mimetype"/>
+
+  <!-- Security -->
+
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" />
+
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+  <role
+      id="zope.Anonymous"
+      title="Everybody"
+      description="All users have this role implicitly"
+      />
+  <role id="zope.Manager" title="Site Manager" />
+
+  <grantAll role="zope.Manager" />
+
+
+  <unauthenticatedPrincipal id="zope.anybody" title="Unauthenticated User" />
+
+  <principal id="zope.mgr" title="Manager" login="mgr" password="mgrpw" />
+
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>


Property changes on: zope.mimetype/trunk/src/zope/mimetype/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zope.mimetype/trunk/src/zope/mimetype/testing.py
===================================================================
--- zope.mimetype/trunk/src/zope/mimetype/testing.py	                        (rev 0)
+++ zope.mimetype/trunk/src/zope/mimetype/testing.py	2007-11-02 03:06:49 UTC (rev 81398)
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""zope.mimetype common test related classes/functions/objects.
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+MimetypeLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'MimetypeLayer', allow_teardown=True)


Property changes on: zope.mimetype/trunk/src/zope/mimetype/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: zope.mimetype/trunk/src/zope/mimetype/tests.py
===================================================================
--- zope.mimetype/trunk/src/zope/mimetype/tests.py	2007-11-02 03:02:14 UTC (rev 81397)
+++ zope.mimetype/trunk/src/zope/mimetype/tests.py	2007-11-02 03:06:49 UTC (rev 81398)
@@ -21,8 +21,8 @@
 
 import zope.interface
 import zope.mimetype.interfaces
+from zope.mimetype import testing
 
-
 class ISampleContentTypeOne(zope.interface.Interface):
     """This is a sample content type interface."""
 ISampleContentTypeOne.setTaggedValue("title", u"Type One")
@@ -45,11 +45,13 @@
 
 
 def test_suite():
+    retrievingMimeTypes = functional.FunctionalDocFileSuite(
+        'retrieving_mime_types.txt',
+        optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+        )
+    retrievingMimeTypes.layer = testing.MimetypeLayer
     return unittest.TestSuite((
-        functional.FunctionalDocFileSuite(
-            'retrieving_mime_types.txt',
-            optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
-            ),
+        retrievingMimeTypes,
         doctest.DocFileSuite('event.txt',
                              setUp=placelesssetup.setUp,
                              tearDown=placelesssetup.tearDown),



More information about the Checkins mailing list