Closed carterbox closed 8 years ago
The version definition mechanism is planned to be replaced with that from dd
, which has also been used in tulip
, which was introduced there with https://github.com/tulip-control/tulip-control/pull/145.
One difference is that gitpython
is used in those versions
Also, I have to note that fetching the version from git
seems simple, but I have found it extremely difficult to write it correctly. The reason is that there are a great number of cases (git
present or not, gitpython
present or not -- in the implementation mentioned above --, git
in path or not, .git
present or not, dirty working directory or not, tagged version or not, tag matched by version regular expression, number within tag matches number declared as version in setup.py
or not, etc.). This situation is aggravated further by the bootstrapping nature of the environment in which this operation can possibly run (user deployment with almost nothing installed).
Having said this, there are a few comments on the changes:
setup.py
instead of version.py
is a good change, and the same as in dd/setup.py
and tulip/setup.py
(flat better than nested, PEP 20). The main reason for doing so is to avoid importing the package (or using imp
to import files from the package) at a stage when no dependency has yet been installed.setuptools
is a valid concern, but not to be addressed at the level of polytope
. An example of a project that aims at providing such functionality is mentioned here.version
in version.py
, which means that __init__.py
will fail to import the version number, which is probably what causes the tests to fail.Cool. I like the way in which tulip creates _version.py
during installation.
The code that appends the git hash to the end of the version number was split between
setup.py
andpolytope.version
. This made it hard to copy into other projects. I have moved some of the git hash code intopolytope.version
such that it is more self-contained. I also think that it makessetup.py
easier to read. The only functional difference you should notice is that now you specify the version number insidesetup.py
above theclassifiers
instead of inpolytope.version
.