Browse files

Merge branch 'release/2.0.4'

  • Loading branch information...
2 parents 5fe0ead + 7b6784e commit 9b6a4682455a9cdff4358d05c26871e1d7bd80f4 @ralphbean ralphbean committed Apr 16, 2012
Showing with 35 additions and 13 deletions.
  1. +1 −0 MANIFEST.in
  2. +4 −4 docs/index.rst
  3. +19 −1 python-tw2-core.spec
  4. +6 −2 setup.py
  5. +1 −1 tests/test_commands.py
  6. +1 −1 tests/test_validation.py
  7. +3 −4 tw2/core/js.py
View
1 MANIFEST.in
@@ -15,3 +15,4 @@ recursive-include tw2/core/templates *.html
recursive-include tw2/core/templates *.tmpl
recursive-include tw2/core/templates *.kid
recursive-include tw2/core/templates *.mak
+prune *.pyc
View
8 docs/index.rst
@@ -42,13 +42,13 @@ ToscaWidgets 2 library packages follow the same naming convention, for example:
* Dynamic database-driven forms with :doc:`tw2 all by its standalone self
</standalone>`.
* Interactive relationship graphs with `tw2.jit and Pyramid
- <http://threebean.wordpress.com/2011/03/07/sqlaradialgraph-in-a-pyramid-app>`_.
+ <http://threebean.org/blog/2011/03/07/sqlaradialgraph-in-a-pyramid-app>`_.
* Interactive relationship graphs with `tw2.jit and TurboGears 2.1
- <http://threebean.wordpress.com/2011/03/06/sqlalchemy-the-javascript-infovis-toolkit-jit>`_.
+ <http://threebean.org/blog/2011/03/06/sqlalchemy-the-javascript-infovis-toolkit-jit>`_.
* `Database-aware jqgrid, with jqplot and portlets in a TG2.1 app
- <http://threebean.wordpress.com/2011/04/30/tutorial-melting-your-face-off-with-tw2-and-turbogears2-1>`_.
+ <http://threebean.org/blog/2011/04/30/tutorial-melting-your-face-off-with-tw2-and-turbogears2-1>`_.
* `Bubble charts with tw2.protovis
- <http://threebean.wordpress.com/2010/10/24/python-wsgi-protovis-barcamproc-fall-2010/>`_.
+ <http://threebean.org/blog/2010/10/24/python-wsgi-protovis-barcamproc-fall-2010/>`_.
* Nightly run `test results <http://tw2-tests.threebean.org/>`_.
* Email list: `toscawidgets-discuss
<http://groups.google.com/group/toscawidgets-discuss/>`_.
View
20 python-tw2-core.spec
@@ -3,7 +3,7 @@
%global modname tw2.core
Name: python-tw2-core
-Version: 2.0.3
+Version: 2.0.4
Release: 1%{?dist}
Summary: Web widget creation toolkit based on TurboGears widgets
@@ -28,6 +28,7 @@ BuildRequires: python-speaklater
BuildRequires: python-paste-deploy
# Specifically for the test suite
+BuildRequires: python-unittest2
BuildRequires: python-nose
BuildRequires: python-coverage
BuildRequires: python-BeautifulSoup
@@ -63,6 +64,18 @@ development tools are in tw2.devtools.
%prep
%setup -q -n %{modname}-%{version}
+%if %{?rhel}%{!?rhel:0} >= 6
+
+# Make sure that epel/rhel picks up the correct version of webob
+awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.0\"]; import pkg_resources"}1' setup.py > setup.py.tmp
+mv setup.py.tmp setup.py
+
+# Remove all the fancy nosetests configuration for older python
+rm setup.cfg
+
+%endif
+
+
%build
%{__python} setup.py build
@@ -83,6 +96,11 @@ rm -rf %{buildroot}
%{python_sitelib}/*
%changelog
+* Mon Apr 16 2012 Ralph Bean <rbean@redhat.com> - 2.0.4-1
+- Packaged latest version of tw2.core which fixes tests on py2.6.
+- Added awk line to make sure pkg_resources picks up the right WebOb on el6
+- Added dependency on python-unittest2
+
* Wed Apr 11 2012 Ralph Bean <rbean@redhat.com> - 2.0.3-1
- Packaged the latest release of tw2.core.
- Fixed rpmlint - python-bytecode-without-source
View
8 setup.py
@@ -7,7 +7,10 @@
# Ridiculous as it may seem, we need to import multiprocessing and logging here
# in order to get tests to pass smoothly on python 2.7.
-import multiprocessing, logging
+try:
+ import multiprocessing, logging
+except:
+ pass
def get_description(fname='README.rst'):
# Adapted from PEAK-Rules' setup.py
@@ -32,7 +35,7 @@ def get_description(fname='README.rst'):
setup(
name='tw2.core',
- version='2.0.3',
+ version='2.0.4',
description="Web widget creation toolkit based on TurboGears widgets",
long_description = get_description(),
install_requires=[
@@ -43,6 +46,7 @@ def get_description(fname='README.rst'):
'decorator',
],
tests_require = [
+ 'unittest2',
'nose',
'coverage',
'BeautifulSoup',
View
2 tests/test_commands.py
@@ -1,7 +1,7 @@
"""
filling in the missing gaps in test coverage
"""
-from unittest import TestCase
+from unittest2 import TestCase
import distutils.dist
import StringIO
import sys
View
2 tests/test_validation.py
@@ -6,7 +6,7 @@
import formencode
from nose.tools import eq_, raises
from webob.multidict import MultiDict
-from unittest import TestCase
+from unittest2 import TestCase
compound_widget = twc.CompoundWidget(id='a', children=[
twc.Widget(id='b', validator=twc.Validator(required=True)),
View
7 tw2/core/js.py
@@ -44,10 +44,6 @@ class TWEncoder(simplejson.encoder.JSONEncoder):
"""
def __init__(self, *args, **kw):
-
- # This is required to get encoding of _js_call to work
- kw['namedtuple_as_object'] = False
-
# This makes encoded objects be prettily formatted. It is very nice for
# debugging and should be made configurable at some point.
# TODO -- make json encoding pretty-printing configurable
@@ -56,6 +52,9 @@ def __init__(self, *args, **kw):
self.pass_through = (_js_call, js_callback, js_symbol, js_function)
super(TWEncoder, self).__init__(*args, **kw)
+ # This is required to get encoding of _js_call to work
+ self.namedtuple_as_object = False
+
def default(self, obj):
if isinstance(obj, self.pass_through):
return self.mark_for_escape(obj)

0 comments on commit 9b6a468

Please sign in to comment.