Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/docset
Browse files Browse the repository at this point in the history
Conflicts:
	docs/Makefile
  • Loading branch information
johntyree committed May 7, 2014
2 parents 4fd0ac7 + af5baf7 commit 82ecf2f
Show file tree
Hide file tree
Showing 155 changed files with 7,340 additions and 9,762 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[run]
branch = True
source = traits
omit = */tests/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

if __name__ == .__main__.:

ignore_errors = True
24 changes: 18 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
language: python
python:
- 2.7
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
install:
- pip install nose
- pip install unittest2
- python setup.py build_ext --inplace
- python setup.py develop
- 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 coverage
- pip install coveralls
- python setup.py install
before_script:
- mkdir testrunner
- cp .coveragerc testrunner/
- cd testrunner
script:
- nosetests
- coverage run -m nose.core traits --exe
notifications:
email:
- travis-ci@enthought.com
after_success:
coveralls
116 changes: 111 additions & 5 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,116 @@
Traits CHANGELOG
================

Since 4.3.0:
Change summary since 4.5.0
~~~~~~~~~~~~~~~~~~~~~~~~~~

* The adaptation mechanism in Traits, formerly based on the 'traits.protocols'
Enhancements

* __iadd__ and __imul__ implemented on TraitListObjects (issue #152).

Changes


Fixes

* Fixed incorrect in list events for `insert` operations with an index outside the
range [-len(target_list), len(target_list)]


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

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

The release also includes increased code coverage and automatic
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).

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).

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.


Release 4.4.0
-------------

The major new feature in this release is a new adaptation mechanism in the
``traits.adaptation`` package. The new mechanism is intended to replace the
older traits.protocols package. Code written against ``traits.protocols`` will
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`
classes, some new helper utilities for writing unit tests for Traits events,
and a variety of bug fixes, stability enhancements, and internal code
improvements.


Change summary since 4.3.0
~~~~~~~~~~~~~~~~~~~~~~~~~~

New features

* The adaptation mechanism in Traits, formerly based on the 'traits.protocols'
package, has been replaced with the more robust 'traits.adaptation'
package.
* Added utility function for importing symbols (name, classes, functions)
by name: 'traits.util.api.import_symbol'.
package. (#51)
* 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)

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)

Refactoring

* 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)
8 changes: 1 addition & 7 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This software is OSI Certified Open Source Software.
OSI Certified is a certification mark of the Open Source Initiative.

Copyright (c) 2006, Enthought, Inc.
Copyright (c) 2006-2014, Enthought, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -26,9 +26,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The software contained in the traits/protocols/ directory is
the pyprotocols project (http://peak.telecommunity.com/PyProtocols.html),
it is originaly licensed under the terms of the Python Software
Foundation License, which is compatible with the above terms.

6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include MANIFEST.in
include LICENSE.txt
include CHANGES.txt
include README.rst
include traits/ctraits.c
include traits/py2to3.h
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ traits: explicitly typed attributes for Python
http://github.enthought.com/traits

.. image:: https://api.travis-ci.org/enthought/traits.png?branch=master
:target: https://api.travis-ci.org/enthought/traits
:target: https://travis-ci.org/enthought/traits
:alt: Build status

.. image:: https://coveralls.io/repos/enthought/traits/badge.png
:target: https://coveralls.io/r/enthought/traits
:alt: Coverage status

The Traits project is at the center of all Enthought Tool Suite development
and has changed the mental model used at Enthought for programming in the
already extremely efficient Python programming language. We encourage everyone
Expand Down
16 changes: 16 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ help:
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " docset to make a docset for use with the Dash/Zeal api browsers"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

Expand Down Expand Up @@ -88,6 +91,19 @@ doctest:
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

docset:
$(SPHINXBUILD) -b html -c source/docset_resources $(ALLSPHINXOPTS) $(BUILDDIR)/docset_html
doc2dash -f -d $(BUILDDIR) -i $(BUILDDIR)/docset_html/_static/e-logo-rev.png -n Traits $(BUILDDIR)/docset_html
8 changes: 4 additions & 4 deletions docs/source/_extensions/refactordoc/line_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# file: line_functions.py
# License: LICENSE.TXT
Expand All @@ -23,7 +23,7 @@


#------------------------------------------------------------------------------
# Functions to manage indention
# Functions to manage indentation
#------------------------------------------------------------------------------

def add_indent(lines, indent=4):
Expand Down Expand Up @@ -70,11 +70,11 @@ def remove_indent(lines):


def trim_indent(lines):
""" Trim global intention level from lines.
""" Trim global indentation level from lines.
"""
non_empty_lines = filter(lambda x: not is_empty(x), lines)
indent = {len(get_indent(line)) for line in non_empty_lines}
indent = set(len(get_indent(line)) for line in non_empty_lines)
indent.discard(0)
global_indent = min(indent)
return [line[global_indent:] for line in lines]
Expand Down
17 changes: 15 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sys.path.append(os.path.abspath('_extensions'))
sys.path.append(os.path.abspath('../../'))

# General configuration
# General configuration
# ---------------------

# Add any Sphinx extension module names here, as strings. They can be extensions
Expand Down Expand Up @@ -78,8 +78,12 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# Options for the autodoc extension.
autodoc_default_flags =['members']

autodoc_member_order = 'bysource'


# Options for HTML output
# -----------------------

Expand Down Expand Up @@ -181,4 +185,13 @@
# If false, no module index is generated.
#latex_use_modindex = True

autodoc_member_order = 'bysource'
# Options for Texinfo output
# --------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'traits', 'Traits 4 User Manual', 'Enthought, Inc.',
'Traits', 'Explicitly typed attributes for Python.', 'Python'),
]
14 changes: 6 additions & 8 deletions docs/source/traits_api_reference/has_traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,16 @@ ABC classes
Functions
---------

.. autofunction:: get_delegate_pattern
.. autofunction:: cached_property

.. autofunction:: trait_method
.. autofunction:: get_delegate_pattern

.. autofunction:: method
.. autofunction:: implements

.. autofunction:: weak_arg
.. autofunction:: on_trait_change

.. autofunction:: property_depends_on

.. autofunction:: cached_property

.. autofunction:: on_trait_change
.. autofunction:: provides

.. autofunction:: implements
.. autofunction:: weak_arg
1 change: 1 addition & 0 deletions docs/source/traits_api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Subpackages

traits.adaptation
traits.etsconfig
traits.protocols
traits.testing
traits.util

Expand Down
6 changes: 1 addition & 5 deletions docs/source/traits_api_reference/trait_notifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ Classes

.. autoclass:: FastUITraitChangeNotifyWrapper

.. autoclass:: UITraitChangeNotifyWrapper

.. autoclass:: DeferredTraitNotification

.. autoclass:: NewTraitChangeNotifyWrapper

Functions
---------

.. autofunction:: set_ui_handler
.. autofunction:: set_ui_handler
2 changes: 0 additions & 2 deletions docs/source/traits_api_reference/trait_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ Traits

.. autoclass:: Disallow

.. autoclass:: missing

.. autoclass:: Constant

.. autoclass:: Delegate
Expand Down
6 changes: 0 additions & 6 deletions docs/source/traits_api_reference/traits.adaptation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
:undoc-members:
:show-inheritance:

.. autofunction:: adapt
.. autofunction:: register_factory
.. autofunction:: register_offer
.. autofunction:: register_provides
.. autofunction:: supports_protocol


:mod:`adaptation_offer` Module
------------------------------
Expand Down
10 changes: 10 additions & 0 deletions docs/source/traits_api_reference/traits.protocols.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:mod:`protocols` Package
========================

.. note:: The :mod:`traits.protocols` package is deprecated. Use the :mod:`traits.adaptation` package instead in new code.


.. automodule:: traits.protocols
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 82ecf2f

Please sign in to comment.