[Repoze-checkins] r1662 - in repoze.bfg/trunk: . repoze/bfg repoze/bfg/paster_template repoze/bfg/paster_template/+package+ repoze/bfg/sampleapp repoze/bfg/tests

Chris McDonough chrism at agendaless.com
Sat Aug 23 21:59:07 EDT 2008


Author: Chris McDonough <chrism at agendaless.com>
Date: Sat Aug 23 21:59:07 2008
New Revision: 1662

Log:
  - Remove ``sampleapp`` sample application from bfg package itself.

  - Remove dependency on FormEncode (only needed by sampleapp).

  - Fix paster template generation so that case-sensitivity is
    preserved for project vs. package name.

  - Depend on ``z3c.pt`` version 1.0a1 (which requires the ``[lxml]``
    extra currently).




Added:
   repoze.bfg/trunk/repoze/bfg/paster_template/+project+.ini_tmpl   (contents, props changed)
Removed:
   repoze.bfg/trunk/repoze/bfg/paster_template/+package+.ini_tmpl
   repoze.bfg/trunk/repoze/bfg/sampleapp/
Modified:
   repoze.bfg/trunk/CHANGES.txt
   repoze.bfg/trunk/repoze/bfg/paster.py
   repoze.bfg/trunk/repoze/bfg/paster_template/+package+/run.py_tmpl
   repoze.bfg/trunk/repoze/bfg/paster_template/+package+/tests.py_tmpl
   repoze.bfg/trunk/repoze/bfg/paster_template/setup.py_tmpl
   repoze.bfg/trunk/repoze/bfg/tests/test_router.py
   repoze.bfg/trunk/repoze/bfg/tests/test_zcml.py
   repoze.bfg/trunk/repoze/bfg/zcml.py
   repoze.bfg/trunk/setup.py

Modified: repoze.bfg/trunk/CHANGES.txt
==============================================================================
--- repoze.bfg/trunk/CHANGES.txt	(original)
+++ repoze.bfg/trunk/CHANGES.txt	Sat Aug 23 21:59:07 2008
@@ -1,10 +1,20 @@
 Next release
 
+  - Remove ``sampleapp`` sample application from bfg package itself.
+
+  - Remove dependency on FormEncode (only needed by sampleapp).
+
+  - Fix paster template generation so that case-sensitivity is
+    preserved for project vs. package name.
+
+  - Depend on ``z3c.pt`` version 1.0a1 (which requires the ``[lxml]``
+    extra currently).
+
   - Read and write a pickled ZCML actions list, stored as
-    ``configure.zcml.pck`` next to the applications's "normal" 
-    configuration file.  A given bfg app will usually start faster
-    if it's able to read the pickle data.  It fails gracefully
-    to reading the real ZCML file if it cannot read the pickle.
+    ``configure.zcml.cache`` next to the applications's "normal"
+    configuration file.  A given bfg app will usually start faster if
+    it's able to read the pickle data.  It fails gracefully to reading
+    the real ZCML file if it cannot read the pickle.
 
 0.3.1 (8/20/2008)
 

Modified: repoze.bfg/trunk/repoze/bfg/paster.py
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/paster.py	(original)
+++ repoze.bfg/trunk/repoze/bfg/paster.py	Sat Aug 23 21:59:07 2008
@@ -4,5 +4,4 @@
 class BFGProjectTemplate(Template):
     _template_dir = 'paster_template'
     summary = 'repoze.bfg starter project'
-    vars = []
     template_renderer = staticmethod(paste_script_template_renderer)

Modified: repoze.bfg/trunk/repoze/bfg/paster_template/+package+/run.py_tmpl
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/paster_template/+package+/run.py_tmpl	(original)
+++ repoze.bfg/trunk/repoze/bfg/paster_template/+package+/run.py_tmpl	Sat Aug 23 21:59:07 2008
@@ -3,9 +3,9 @@
 
 def app(global_config, **kw):
     # paster app config callback
-    from {{project}}.models import get_root
-    import {{ project}}
-    return make_app(get_root, {{project}}, options=get_options(kw))
+    from {{package}}.models import get_root
+    import {{package}}
+    return make_app(get_root, {{package}}, options=get_options(kw))
 
 if __name__ == '__main__':
     from paste import httpserver

Modified: repoze.bfg/trunk/repoze/bfg/paster_template/+package+/tests.py_tmpl
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/paster_template/+package+/tests.py_tmpl	(original)
+++ repoze.bfg/trunk/repoze/bfg/paster_template/+package+/tests.py_tmpl	Sat Aug 23 21:59:07 2008
@@ -11,10 +11,10 @@
         # should explore ways to do that rather than rely on ZCML (see
         # the repoze.bfg tests for inspiration).
         self._cleanup()
-        import {{project}}
+        import {{package}}
         import zope.configuration.xmlconfig
         zope.configuration.xmlconfig.file('configure.zcml',
-                                          package={{project}})
+                                          package={{package}})
 
     def tearDown(self):
         self._cleanup()
@@ -25,13 +25,13 @@
         cleanUp()
         
     def test_my_view(self):
-        from {{project}}.views import my_view
+        from {{package}}.views import my_view
         context = DummyContext()
         request = DummyRequest()
         result = my_view(context, request)
         self.assertEqual(result.status, '200 OK')
         body = result.app_iter[0]
-        self.failUnless('Welcome to {{project}}' in body)
+        self.failUnless('Welcome to {{package}}' in body)
         self.assertEqual(len(result.headerlist), 2)
         self.assertEqual(result.headerlist[0],
                          ('content-type', 'text/html; charset=UTF-8'))

Added: repoze.bfg/trunk/repoze/bfg/paster_template/+project+.ini_tmpl
==============================================================================
--- (empty file)
+++ repoze.bfg/trunk/repoze/bfg/paster_template/+project+.ini_tmpl	Sat Aug 23 21:59:07 2008
@@ -0,0 +1,12 @@
+[DEFAULT]
+debug = true
+
+[app:main]
+use = egg:{{project}}#app
+reload_templates = true
+
+[server:main]
+use = egg:PasteScript#cherrypy
+host = 0.0.0.0
+port = 6543
+numthreads = 4

Modified: repoze.bfg/trunk/repoze/bfg/paster_template/setup.py_tmpl
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/paster_template/setup.py_tmpl	(original)
+++ repoze.bfg/trunk/repoze/bfg/paster_template/setup.py_tmpl	Sat Aug 23 21:59:07 2008
@@ -35,10 +35,10 @@
       tests_require=[
             'repoze.bfg',
             ],
-      test_suite="{{project}}",
+      test_suite="{{package}}",
       entry_points = """\
       [paste.app_factory]
-      app = {{project}}.run:app
+      app = {{package}}.run:app
       """
       )
 

Modified: repoze.bfg/trunk/repoze/bfg/tests/test_router.py
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/tests/test_router.py	(original)
+++ repoze.bfg/trunk/repoze/bfg/tests/test_router.py	Sat Aug 23 21:59:07 2008
@@ -276,7 +276,7 @@
         from repoze.bfg.router import make_app
         return make_app
 
-    def test_sampleapp(self):
+    def test_fixtureapp(self):
         from repoze.bfg.tests import fixtureapp
         make_app = self._getFUT()
         rootpolicy = make_rootpolicy(None)

Modified: repoze.bfg/trunk/repoze/bfg/tests/test_zcml.py
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/tests/test_zcml.py	(original)
+++ repoze.bfg/trunk/repoze/bfg/tests/test_zcml.py	Sat Aug 23 21:59:07 2008
@@ -114,7 +114,7 @@
         self.assertEqual(regadapt['args'][4], '')
         self.assertEqual(regadapt['args'][5], None)
 
-class TestSampleApp(unittest.TestCase, PlacelessSetup):
+class TestFixtureApp(unittest.TestCase, PlacelessSetup):
     def setUp(self):
         PlacelessSetup.setUp(self)
 
@@ -122,7 +122,7 @@
         PlacelessSetup.tearDown(self)
 
     def test_registry_actions_can_be_pickled_and_unpickled(self):
-        import repoze.bfg.sampleapp as package
+        import repoze.bfg.tests.fixtureapp as package
         from zope.configuration import config
         from zope.configuration import xmlconfig
         context = config.ConfigurationMachine()
@@ -152,7 +152,7 @@
         self.i += 1
         self.packagepath = os.path.join(tempdir, modname)
         fixturedir = package_path(package)
-        pckname = os.path.join(fixturedir, 'configure.zcml.pck')
+        pckname = os.path.join(fixturedir, 'configure.zcml.cache')
         if os.path.isfile(pckname):
             os.remove(pckname)
         shutil.copytree(fixturedir, self.packagepath)
@@ -175,7 +175,7 @@
         import cPickle
         from repoze.bfg.zcml import file_configure
         self.assertEqual(False, file_configure('configure.zcml', self.module))
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))
         self.failUnless(actions)
@@ -194,7 +194,7 @@
             raise IOError
         self.assertEqual(False,
                       file_configure('configure.zcml', self.module, dumpfail))
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.failIf(os.path.exists(picklename))
 
     def test_zcml_configure_writes_pickle_when_none_exists(self):
@@ -202,7 +202,7 @@
         import cPickle
         from repoze.bfg.zcml import zcml_configure
         self.assertEqual(False, zcml_configure('configure.zcml', self.module))
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))
         self.failUnless(actions)
@@ -211,7 +211,7 @@
         import os
         import cPickle
         from repoze.bfg.zcml import zcml_configure
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         f = open(picklename, 'wb')
         cPickle.dump((), f)
         f.close()
@@ -220,7 +220,7 @@
     def test_zcml_configure_uses_file_configure_with_bad_pickle2(self):
         import os
         from repoze.bfg.zcml import zcml_configure
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         f = open(picklename, 'wb')
         f.write('garbage')
         f.close()
@@ -232,7 +232,7 @@
         import time
         from repoze.bfg.zcml import zcml_configure
         basename = os.path.join(self.packagepath, 'configure.zcml')
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.assertEqual(False, zcml_configure('configure.zcml', self.module))
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))
@@ -246,7 +246,7 @@
         import time
         from repoze.bfg.zcml import zcml_configure
         basename = os.path.join(self.packagepath, 'another.zcml')
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.assertEqual(False, zcml_configure('configure.zcml', self.module))
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))
@@ -260,7 +260,7 @@
         from repoze.bfg.zcml import zcml_configure
         from zope.configuration.xmlconfig import ZopeXMLConfigurationError
         basename = os.path.join(self.packagepath, 'another.zcml')
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.assertEqual(False, zcml_configure('configure.zcml', self.module))
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))
@@ -273,7 +273,7 @@
         import os
         from repoze.bfg.zcml import zcml_configure
         from repoze.bfg.zcml import PVERSION
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         f = open(picklename, 'wb')
         import cPickle
         data = (PVERSION+1, 0, [])
@@ -284,7 +284,7 @@
         import os
         from repoze.bfg.zcml import zcml_configure
         from repoze.bfg.zcml import PVERSION
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         f = open(picklename, 'wb')
         import cPickle
         data = (PVERSION, None, [])
@@ -296,7 +296,7 @@
         from repoze.bfg.zcml import zcml_configure
         from repoze.bfg.zcml import PVERSION
         import time
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         f = open(picklename, 'wb')
         import cPickle
         data = (PVERSION, time.time()+500, None)
@@ -310,7 +310,7 @@
         from repoze.bfg.zcml import zcml_configure
         from repoze.bfg.zcml import PVERSION
         basename = os.path.join(self.packagepath, 'another.zcml')
-        picklename = os.path.join(self.packagepath, 'configure.zcml.pck')
+        picklename = os.path.join(self.packagepath, 'configure.zcml.cache')
         self.assertEqual(False, zcml_configure('configure.zcml', self.module))
         self.failUnless(os.path.exists(picklename))
         actions = cPickle.load(open(picklename, 'rb'))

Modified: repoze.bfg/trunk/repoze/bfg/zcml.py
==============================================================================
--- repoze.bfg/trunk/repoze/bfg/zcml.py	(original)
+++ repoze.bfg/trunk/repoze/bfg/zcml.py	Sat Aug 23 21:59:07 2008
@@ -98,7 +98,7 @@
 def pickle_name(name, package):
     path = package_path(package)
     basename = os.path.join(path, name)
-    return os.path.join(path, basename + '.pck')
+    return os.path.join(path, basename + '.cache')
 
 def zcml_configure(name, package, load=cPickle.load):
     """ Execute pickled zcml actions or fall back to parsing from file

Modified: repoze.bfg/trunk/setup.py
==============================================================================
--- repoze.bfg/trunk/setup.py	(original)
+++ repoze.bfg/trunk/setup.py	Sat Aug 23 21:59:07 2008
@@ -12,7 +12,7 @@
 #
 ##############################################################################
 
-__version__ = '0.3.1'
+__version__ = '0.3.2'
 
 import os
 
@@ -54,10 +54,8 @@
             'zope.hookable',
             'zope.event',
             'WebOb',
-            'Paste',
-            'z3c.pt',
-            'FormEncode',
             'PasteScript',
+            'z3c.pt [lxml]',
             'Routes',
             ],
       tests_require=[
@@ -67,10 +65,8 @@
             'zope.hookable',
             'zope.event',
             'WebOb',
+            'z3c.pt [lxml]',
             'Paste',
-            'z3c.pt',
-            'FormEncode',
-            'PasteScript',
             'Routes',
             'Sphinx',
             'docutils',


More information about the Repoze-checkins mailing list