Skip to content

Commit

Permalink
Merge pull request #186 from enthought/backport-fixes
Browse files Browse the repository at this point in the history
Backport fixes from master
  • Loading branch information
itziakos committed Apr 10, 2015
2 parents 32cb3aa + 0a065e2 commit 10a7875
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 44 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -17,7 +17,6 @@ before_install:
install:
# nose is already installed
# numpy is already installed
- pip install cython
- pip install -r dev_requirements.txt
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r requirements-2.6.txt; fi
- pip install coveralls
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.txt
@@ -1,6 +1,16 @@
Enable CHANGELOG
================

Enable 4.5.1 (April 9, 2015)
============================

Fixes
-----

* PR #182: Fix enable setup under recent versions of setuptools
* PR #180: Fixed sphinx warnings
* PR #178: Fix Travis-CI build and version file setup for kiva and enable

Enable 4.5.0 (March 23, 2015)
=============================

Expand Down
41 changes: 30 additions & 11 deletions README.rst
Expand Up @@ -4,7 +4,7 @@ enable: low-level drawing and interaction

http://github.enthought.com/enable

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

Expand Down Expand Up @@ -64,17 +64,36 @@ Kiva currently implements the following features:
- RGB, RGBA, or grayscale color depths
- transparency


Prerequisites
-------------

You must have the following libraries installed before building or installing
the Enable project:
You must have the following libraries installed before building
the Enable/Kiva project:

- `Setuptools <https://pypi.python.org/pypi/setuptools>`_
- `Numpy <http://pypi.python.org/pypi/numpy>`_
- `SWIG <http://www.swig.org/>`_
- (on Linux) X11-devel (development tools for X11)
- (on Mac OS X) `Cython <http://www.cython.org>`_

Enable/Kiva also have the following requirements:

.. rubric:: Runtime:

- `Numpy <http://pypi.python.org/pypi/numpy>`_
- `PIL <http://www.pythonware.com/products/pil>`_
- `traits 4.5.0 <https://pypi.python.org/pypi/traits>`_
- `traitsui 4.4.0 <https://pypi.python.org/pypi/traitsui>`_
- `pyface 4.5.0 <https://pypi.python.org/pypi/pyface>`_

.. rubric:: Optional:

* `distribute <http://pypi.python.org/pypi/distribute>`_
* `SWIG <http://www.swig.org/>`_
* `Cython <http://www.cython.org>`_
* `Numpy <http://pypi.python.org/pypi/numpy>`_
* `ReportLab Toolkit <http://www.reportlab.org/rl_toolkit.html/>`_ for PDF
backend support in Kiva.
* (on Linux) X11-devel (development tools for X11)
- `apptools 4.3.0 <https://pypi.python.org/pypi/apptools/>`_
- (Qt backend) `PySide <https://pypi.python.org/pypi/PySide>`_ or `PyQt4 <https://pypi.python.org/pypi/PyQt4>`_
- (WX backend) `WxPython version 2.8.11.0 <https://pypi.python.org/pypi/wxPython/2.8.11.0>`_
- (GL backend) `pyglet version 1.1.4 <https://bitbucket.org/pyglet/pyglet/get/pyglet-1.1.4.zip>`_
- (GL backend) `pygarrayimage <https://pypi.python.org/pypi/pygarrayimage>`_
- (SVG backend) `PyParsing <https://pypi.python.org/pypi/pyparsing>`_
- (PDF backend) `ReportLab Toolkit version 3.1 <http://www.reportlab.org/rl_toolkit.html/>`_
- (Cairo backend) `PyCairo 1.10.0 <http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2>`_
- (Constrained layout) `kiwisolver <https://pypi.python.org/pypi/kiwisolver>`_
11 changes: 6 additions & 5 deletions dev_requirements.txt
@@ -1,14 +1,15 @@
--allow-external PIL
--allow-unverified PIL
numpy
coverage
PIL
pyparsing
PyPDF2
https://bitbucket.org/pyglet/pyglet/get/pyglet-1.1.4.zip
pygarrayimage
reportlab<=3.1
-e git+http://github.com/enthought/traits.git#egg=traits
-e git+http://github.com/enthought/pyface.git#egg=pyface
-e git+http://github.com/enthought/traitsui.git#egg=traitsui
-e git+http://github.com/enthought/apptools.git#egg=apptools
-e git+http://github.com/nucleic/kiwi.git#egg=kiwisolver
kiwisolver
git+http://github.com/enthought/traits.git#egg=traits
git+http://github.com/enthought/pyface.git#egg=pyface
git+http://github.com/enthought/traitsui.git#egg=traitsui
git+http://github.com/enthought/apptools.git#egg=apptools
2 changes: 1 addition & 1 deletion docs/source/enable_basic_tools.rst
Expand Up @@ -30,7 +30,7 @@ state changes.

By default, the tool responds to clicks that are within the associated
component, but subclasses can override this behaviour by replacing the
:py:method:`is_clickable` method with something else.
:py:meth:`is_clickable` method with something else.

It will commonly be the case that components or :py:class:`ButtonTool`
subclasses which draw may wish to respond to user interactions by drawing
Expand Down
40 changes: 22 additions & 18 deletions docs/source/enable_constraints_layout.rst
Expand Up @@ -23,7 +23,7 @@ to the :class:`Component` class which define a simple box model:
* :attr:`h_center`: The vertical center line between the left and right edges
* :attr:`v_center`: The horizontal center line between the top and bottom edges

Additionally, there are some constraints which only exist on
Additionally, there are some constraints which only exist on
:class:`ConstraintsContainer`:

* :attr:`contents_height`: The height of the container.
Expand All @@ -37,7 +37,9 @@ Additionally, there are some constraints which only exist on

These variables can be used in linear inequality expressions which make up the
layout constraints of a container:

::

def build_hierarchy():
container = ConstraintsContainer()
one = Component()
Expand All @@ -48,27 +50,29 @@ layout constraints of a container:
one.layout_height == two.layout_height,
# ... and so on ...
]

return container

For more complicated layouts, the :attr:`layout_constraints` trait on a
:class:`ConstraintsContainer` can be a :class:`callable`. The function is
passed a reference to the container and should return a list of
:class:`LinearContraints` objects or layout helper instances (as described below).

::
def create_container(self):

def create_container(self):
self.container = ConstraintsContainer()
self.container.add(self.bar)
self.container.layout_constraints = self.my_layout_constraints

def my_layout_constraints(self, container):
cns = []

if self.foo:
cns.append(self.foo.layout_height <= 300)
cns.append(hbox(self.foo, self.bar))
cns.append(self.bar.layout_width == 250)

return cns

If :attr:`layout_constraints` is callable, it will be invoked each time a
Expand All @@ -85,25 +89,25 @@ also available in Enable. The layout helpers are:
:data:`spacer`: Creates space between two adjacent components.

.. function:: horizontal(*components[, spacing=10])

Takes a list of components and lines them up using their left and right edges.

:param components: A sequence of :class:`Component` or :class:`spacer` objects.
:param spacing: How many pixels of inter-element spacing to use
:type spacing: integer >= 0

.. function:: vertical(*components[, spacing=10])

Takes a list of components and lines them up using their top and bottom edges.

:param components: A sequence of :class:`Component` or :class:`spacer` objects.
:param spacing: How many pixels of inter-element spacing to use
:type spacing: integer >= 0

.. function:: hbox(*components[, spacing=10, margins=...])

Like :func:`horizontal`, but ensures the height of components matches the container.

:param components: A sequence of :class:`Component` or :class:`spacer` objects.
:param spacing: How many pixels of inter-element spacing to use
:type spacing: integer >= 0
Expand All @@ -112,9 +116,9 @@ also available in Enable. The layout helpers are:
of the box. The default is 0.

.. function:: vbox(*components[, spacing=10, margins=...])

Like :func:`vertical`, but ensures the width of components matches the container.

:param components: A sequence of :class:`Component` or :class:`spacer` objects.
:param spacing: How many pixels of inter-element spacing to use
:type spacing: integer >= 0
Expand All @@ -123,19 +127,19 @@ also available in Enable. The layout helpers are:
of the box. The default is 0.

.. function:: align(anchor, *components[, spacing=10])

Aligns a single constraint across multiple components.

:param anchor: The name of a constraint variable that exists on all of the
`components`.
:param components: A sequence of :class:`Component` objects. Spacers are not allowed.
:param spacing: How many pixels of inter-element spacing to use
:type spacing: integer >= 0

.. function:: grid(*rows[, row_align='', row_spacing=10, column_align='', column_spacing=10, margins=...])

Creates an NxM grid of components. Components may span multiple columns or rows.

:param rows: A sequence of sequences of :class:`Component` objects
:param row_align: The name of a constraint variable on an item. If given,
it is used to add constraints on the alignment of items
Expand Down
14 changes: 12 additions & 2 deletions enable/__init__.py
Expand Up @@ -3,11 +3,21 @@
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
import sys
from ._version import full_version as __version__

from kiva._version import full_version as __version__
__all__ = [
'__version__',
]

__requires__ = [
'numpy',
'traits',
'traitsui',
'PIL',
'kiwisolver',
'pyface',
]

# Cython is only necessary to build the quartz backend.
if sys.platform == 'darwin':
__requires__.append('cython')
11 changes: 5 additions & 6 deletions setup.py
Expand Up @@ -32,12 +32,11 @@

from numpy.distutils.core import setup


MAJOR = 4
MINOR = 5
MICRO = 0
MICRO = 1

IS_RELEASED = True
IS_RELEASED = False

VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

Expand Down Expand Up @@ -76,7 +75,7 @@ def _minimal_ext_cmd(cmd):
return git_revision, git_count


def write_version_py(filename='kiva/_version.py'):
def write_version_py(filename):
template = """\
# THIS FILE IS GENERATED FROM ENABLE SETUP.PY
version = '{version}'
Expand Down Expand Up @@ -192,7 +191,8 @@ def run(self):


if __name__ == "__main__":
write_version_py()
write_version_py(filename='enable/_version.py')
write_version_py(filename='kiva/_version.py')
from enable import __version__, __requires__

# Build the full set of packages by appending any found by setuptools'
Expand Down Expand Up @@ -245,6 +245,5 @@ def run(self):
'enable': ['tests/primitives/data/PngSuite/*.png'],
},
platforms=["Windows", "Linux", "Mac OS-X", "Unix", "Solaris"],
setup_requires=['cython'],
zip_safe=False,
**config)

0 comments on commit 10a7875

Please sign in to comment.