tulip-control/polytope — pull request #8 by johnyf (2014-05-04 10:30:28+00:00)
Title: mv version to polytope/version.py

to have a single place where it is defined, while avoiding importing the `polytope` package when importing the version into `setup.py`.
After thinking of creating a `polytope/__version__.py` file, searching led to [this discussion](http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package)

Justification for design choices:

- file named `version.py` instead of `__version__.py` because `__version__` must be a string according to [PEP 396](http://legacy.python.org/dev/peps/pep-0396/).

- variable in `version.py` named version instead of `__version__` to avoid creating a `__main__.__version__` variable when exec is executed within `setup.py`

- the `exec` command avoids loading the `polytope` package, was borrowed from the discussion linked above. If instead one attempts to use from `polytope.version import __version__` in `setup.py`, the `polytope.__init__` will be automatically imported, triggering imports from `polytope.polytope`, which in turn requires `numpy` that may not yet be installed, because all this occurs before setup tools fetch and install dependencies.

- variable `version_info` seems to be common practice

Drawbacks of the approach: file littering, ugly `exec` command