Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gag-noisy-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Dec 19, 2014
2 parents dcf4793 + 2204895 commit 0315fa6
Show file tree
Hide file tree
Showing 38 changed files with 919 additions and 989 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -11,3 +11,6 @@
build/
dist/
docs/build/

# Auto-generated by setup.py
traits/_version.py
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -9,10 +9,10 @@ install:
- pip install -U nose
- if ! [[ $TRAVIS_PYTHON_VERSION > '2.6' ]]; then pip install unittest2 ; fi
- if [[ $TRAVIS_PYTHON_VERSION > '3.' ]]; then pip install numpy ; fi
- pip install cython
- pip install --install-option="--no-cython-compile" cython
- pip install coverage
- pip install coveralls
- python setup.py install
- python setup.py develop
before_script:
- mkdir testrunner
- cp .coveragerc testrunner/
Expand Down
108 changes: 60 additions & 48 deletions CHANGES.txt
Expand Up @@ -6,54 +6,66 @@ Change summary since 4.5.0

Enhancements

* Added Trait change recorder to aid in debugging event-driven code (#139).
* __iadd__ and __imul__ implemented on TraitListObjects (issue #152).
* Added Trait change recorder to aid in debugging event-driven code. (#139)
* ``__iadd__`` and ``__imul__`` implemented on TraitListObjects. (#165)
* Added new ``ArrayOrNone`` trait type to replace the
``Either(None, Array)`` idiom. The old idiom results in warnings
on NumPy >= 1.9. (#219)

Changes

* Remove outdated ``ImportSpy`` and ``ImportManager`` utilities. (#188)
* The ``deprecated`` decorator now issues a DeprecationWarning (using
the Python ``warnings`` module) rather than logging a warning via
the ``logging`` machinery. It no longer tries to remember when
a warning has been previously issued. (#220)
* Deprecated ``HasTraits.get()`` and ``HasTraits.set()`` (#190).

Fixes

* Fixed incorrect in list events for `insert` operations with an index outside the
range [-len(target_list), len(target_list)]
* Fixed incorrect in list events for ``insert`` operations with an index
outside the range [``-len(target_list)``, ``len(target_list)``]. (#165)
* Fix incorrect behaviour of ``check_implements`` for overridden methods.
(#192)
* Fix error when trying to listen to traits using list bracket notation. (#195)


Release 4.5.0
-------------

Traits is now compatible with Python 3! The library now supports
Python 3.2 and 3.3 .
Python 3.2 and 3.3.

The release also includes increased code coverage and automatic
coverage report through coveralls.io .
coverage report through coveralls.io.


Change summary since 4.4.0
~~~~~~~~~~~~~~~~~~~~~~~~~~

Enhancements

* Test files cleanups (#108, #111, #121)
* Add automatic coverage reports (#110, #122)
* Removed obsolete code (#109, #112, #113)
* Increased test coverage (#114, #118)
* Python 3 support (#115). Thanks Yves Delley.
* Allow setting and resetting the global adaptation manager (#145)
* Various documentation improvements (#132, #133, #148, #154).
* Test files cleanups (#108, #111, #121)
* Add automatic coverage reports (#110, #122)
* Removed obsolete code (#109, #112, #113)
* Increased test coverage (#114, #118)
* Python 3 support (#115). Thanks Yves Delley.
* Allow setting and resetting the global adaptation manager (#145)
* Various documentation improvements (#132, #133, #148, #154).

Changes

* The Int trait type now accepts Python ints *and* Python longs, as well as
instances of any Python type that implements the `__index__` method.
Previously, long instances were not accepted. (#104, #123).
* The Int trait type now accepts Python ints *and* Python longs, as well as
instances of any Python type that implements the ``__index__`` method.
Previously, long instances were not accepted. (#104, #123).

Fixes

* Fix crash when trying to validate a property that has been deleted. (#138)
* Fix clearing exception when raising a TraitError (#119)
* Fix automatic adaptation when assigning to List trait (#147)
* Fix some ctraits refcounting and exception clearing bugs (#48). Thanks Yves
Delley.
* Fix crash when trying to validate a property that has been deleted. (#138)
* Fix clearing exception when raising a TraitError (#119)
* Fix automatic adaptation when assigning to List trait (#147)
* Fix some ctraits refcounting and exception clearing bugs (#48). Thanks Yves
Delley.


Release 4.4.0
Expand All @@ -66,7 +78,7 @@ continue to work, although the ``traits.protocols`` API has been deprecated,
and a warning will be logged on first use of ``traits.protocols``. See the
'Advanced Topics' section of the user manual for more details.

The release also includes improved support for using Cython with `HasTraits`
The release also includes improved support for using Cython with ``HasTraits``
classes, some new helper utilities for writing unit tests for Traits events,
and a variety of bug fixes, stability enhancements, and internal code
improvements.
Expand All @@ -77,41 +89,41 @@ Change summary since 4.3.0

New features

* The adaptation mechanism in Traits, formerly based on the 'traits.protocols'
* The adaptation mechanism in Traits, formerly based on the 'traits.protocols'
package, has been replaced with the more robust 'traits.adaptation'
package. (#51)
* Added utility function for importing symbols (name, classes, functions)
* Added utility function for importing symbols (name, classes, functions)
by name: 'traits.util.api.import_symbol'. (#51)
* Users can set a global tracer, which receives all traits change events:
`traits.trait_notifiers.set_change_event_tracers`. (#79)
* Users can set a global tracer, which receives all traits change events:
``traits.trait_notifiers.set_change_event_tracers``. (#79)

Enhancements

* Update benchmark script. (#54)
* traits.util.deprecated: use module logger instead of root logger. (#59)
* Provide an informative message in AdaptationError. (#62)
* Allow HasTraits classes to be cythonized. (#73)
* Improve tests for cythonization support. (#75)
* Extending various trait testing helpers (#53)
* Update benchmark script. (#54)
* traits.util.deprecated: use module logger instead of root logger. (#59)
* Provide an informative message in AdaptationError. (#62)
* Allow HasTraits classes to be cythonized. (#73)
* Improve tests for cythonization support. (#75)
* Extending various trait testing helpers (#53)

Refactoring

* The Traits notification code has been reworked to remove code duplication,
and test coverage of that code has been significantly improved. (#79)
* The Traits notification code has been reworked to remove code duplication,
and test coverage of that code has been significantly improved. (#79)

Fixes

* Fix race condition when removing a traits listener. (#57)
* Fix ugly interaction between DelegatesTo change handlers, dynamic change
handlers and two levels of dynamic intialization. (#63)
* Use a NullHandler for all 'traits' loggers. (#64)
* Fix race condition in TraitChangeNotifyWrapper.listener_deleted (#66)
* Fix leaking notifiers. (#68)
* Fix failing special instance trait events. (#78)
* Fix hiding KeyError exception inside trait default initialize method.
(#81)
* Fix Adapter object initialization. (#93)
* Fix cyclic garbage arising from use of the WeakRef trait type. (#95)
* `TraitSetObject.copy` now returns a plain rather than an
uninitialized `TraitSetObject` instance. (#97)
* Fix cyclic garbage arising from dynamic trait change handlers. (#101)
* Fix race condition when removing a traits listener. (#57)
* Fix ugly interaction between DelegatesTo change handlers, dynamic change
handlers and two levels of dynamic intialization. (#63)
* Use a NullHandler for all 'traits' loggers. (#64)
* Fix race condition in TraitChangeNotifyWrapper.listener_deleted (#66)
* Fix leaking notifiers. (#68)
* Fix failing special instance trait events. (#78)
* Fix hiding KeyError exception inside trait default initialize method.
(#81)
* Fix Adapter object initialization. (#93)
* Fix cyclic garbage arising from use of the WeakRef trait type. (#95)
* ``TraitSetObject.copy`` now returns a plain rather than an
uninitialized ``TraitSetObject`` instance. (#97)
* Fix cyclic garbage arising from dynamic trait change handlers. (#101)
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -2,7 +2,7 @@
traits: explicitly typed attributes for Python
==============================================

http://github.enthought.com/traits
http://docs.enthought.com/traits

.. image:: https://api.travis-ci.org/enthought/traits.png?branch=master
:target: https://travis-ci.org/enthought/traits
Expand Down
2 changes: 2 additions & 0 deletions docs/source/traits_api_reference/trait_numeric.rst
Expand Up @@ -11,6 +11,8 @@ Classes

.. autoclass:: Array

.. autoclass:: ArrayOrNone

.. autoclass:: CArray

Function
Expand Down
2 changes: 1 addition & 1 deletion docs/source/traits_user_manual/advanced.rst
Expand Up @@ -1338,7 +1338,7 @@ corresponding to each keyword to the matching value. This shorthand is useful
when a number of trait attributes need to be set on an object, or a trait
attribute value needs to be set in a lambda function. For example::

person.set(name='Bill', age=27)
person.trait_set(name='Bill', age=27)

The statement above is equivalent to the following::

Expand Down
8 changes: 7 additions & 1 deletion docs/source/traits_user_manual/defining.rst
Expand Up @@ -258,6 +258,9 @@ the table.
| Array | Array( [*dtype* = None, *shape* = None, *value* = None, |
| | *typecode* = None, \*\*\ *metadata*] ) |
+------------------+----------------------------------------------------------+
| ArrayOrNone | ArrayOrNone( [*dtype* = None, *shape* = None, |
| | *value* = None, *typecode* = None, \*\*\ *metadata*] ) |
+------------------+----------------------------------------------------------+
| Button | Button( [*label* = '', *image* = None, *style* = |
| | 'button', *orientation* = 'vertical', *width_padding* = |
| | 7, *height_padding* = 5, \*\*\ *metadata*] ) |
Expand Down Expand Up @@ -583,7 +586,10 @@ HasTraits objects:
* **desc**: A string describing the intended meaning of the trait. It is used
in exception messages and fly-over help in user interface trait editors.
* **editor**: Specifies an instance of a subclass of TraitEditor to use when
creating a user interface editor for the trait. Refer to the `TraitsUI User Manual <http://github.enthought.com/traitsui/index.html>`_ for more information on trait editors.
creating a user interface editor for the trait. Refer to the
`TraitsUI User Manual
<http://docs.enthought.com/traitsui/traitsui_user_manual/index.html>`_
for more information on trait editors.
* **label**: A string providing a human-readable name for the trait. It is
used to label trait attribute values in user interface trait editors.
* **rich_compare**: A Boolean indicating whether the basis for considering a
Expand Down
6 changes: 4 additions & 2 deletions docs/source/traits_user_manual/intro.rst
Expand Up @@ -12,7 +12,8 @@ website. Additional documentation for the Traits package is available from
the Traits web page, including:

* *Traits API Reference*
* `TraitsUI User Manual <http://github.enthought.com/traitsui/index.html>`_
* `TraitsUI User Manual
<http://docs.enthought.com/traitsui/traitsui_user_manual/index.html>`_
* Traits Technical Notes

What Are Traits?
Expand Down Expand Up @@ -53,7 +54,8 @@ attributes, giving the attributes some additional characteristics:
the traits' definitions. This feature requires that a supported GUI
toolkit be installed. However, if this feature is not used, the Traits package
does not otherwise require GUI support. For details on the visualization
features of Traits, see the `TraitsUI User Manual <http://github.enthought.com/traitsui/index.html>`_.
features of Traits, see the `TraitsUI User Manual
<http://docs.enthought.com/traitsui/traitsui_user_manual/index.html>`_.

A class can freely mix trait-based attributes with normal Python attributes,
or can opt to allow the use of only a fixed or open set of trait attributes
Expand Down
18 changes: 7 additions & 11 deletions examples/tutorials/tutor.py
Expand Up @@ -610,7 +610,7 @@ def _load_dirs ( self ):
self._subsections = [
sf.section for sf in [
SectionFactory( title = title_for( title ),
parent = self ).set(
parent = self ).trait_set(
path = dir )
for index, title, dir in dirs
] if sf.section is not None
Expand Down Expand Up @@ -657,16 +657,13 @@ def _load_toc ( self ):
if len( names ) == 1:
dir = os.path.join( path, names[0] )
if os.path.isdir( dir ):
subsections[i] = SectionFactory( title = title,
parent = self ).set(
path = dir ).section
factory = SectionFactory(title=title, parent=self)
subsections[i] = factory.trait_set(path=dir).section
continue

# Otherwise, create a section from the list of matching files:
subsections[i] = SectionFactory( title = title,
parent = self,
files = names ).set(
path = path ).section
factory = SectionFactory(title=title, parent=self, files=names)
subsections[i] = factory.trait_set(path=path).section

# Set the subsections to the non-None values that are left:
self._subsections = [ subsection for subsection in subsections
Expand Down Expand Up @@ -1748,7 +1745,7 @@ def init_tutor ( self ):
"""
path = self.path
title = title_for( os.path.splitext( os.path.basename( path ) )[0] )
section = SectionFactory( title = title ).set( path = path ).section
section = SectionFactory(title=title).trait_set(path=path).section
if section is not None:
self.section = self.root = section

Expand All @@ -1771,7 +1768,7 @@ def init_tutor ( self ):
path = os.getcwd()

# Create a tutor and display the tutorial:
tutor = Tutor( home = os.path.dirname( sys.argv[0] ) ).set(
tutor = Tutor( home = os.path.dirname( sys.argv[0] ) ).trait_set(
path = path )
if tutor.root is not None:
tutor.configure_traits()
Expand All @@ -1783,4 +1780,3 @@ def init_tutor ( self ):
If tutorial_path is omitted, the current directory is assumed to be the root of
the tutorial.""" % path

0 comments on commit 0315fa6

Please sign in to comment.