ferno/greenery — pull request #10 by pjkundert (2014-03-04 22:48:38+00:00)
Title: Feature version 2

I have rolled the major version number to 2.0, due to the change in interface from version 1.x. There are *no* functionality changes with this release.

As requested, the recommended method is to import names from greenery.lego or greenery.fsm
directly, instead of getting the entire lego/fsm namespace when you import greenery (only greenery.__version__ is defined). All other lego/fsm packages and/or names must be imported specifically (both are imported if 'from greenery import *' is used).

However, for compatibility with existing code, I have added a backwards compatible interface:

import greenery.v1 as greenery

which retains the former interface, and allows existing code to work with no changes, under greenery version 2.0+.

Version 1.x style code that wishes to be compatible with either 1.x or 2.0+ version can use:

try:
import greenery.v1 as greenery
except ImportError:
import greenery

In addition, to ease testing, all unit tests have been broken out into py.test compatible 'lego_test.py' and 'fsm_test.py' files; no changes to the tests have been made. These tests are runnable either using py.test, or (if you prefer), by directly running the ..._test.py file. However, in this form, these files must specify their current parent directory as the first entry in their sys.path. If this is *not* done, then these tests actually test the currently *installed* version of greenery -- not the version where they are run. This is also a problem with the tests when run in-place in the current 1.x master branch. This path manipulation is restricted to precisely the situation where it is absolutely required -- when the tests are run in-place.

Finally, a GNU 'make' file has been provided to ease testing and installation against all supported/available versions of Python.