-
Notifications
You must be signed in to change notification settings - Fork 440
Add conda build recipe and improve version numbering #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a lot of unnecessarily complex logic in setup.py, taken from numpy, about whether to use setuptools or distutils. In addition, the procedure for generating the version information was only partially automatic (one still needed to change the version manually in setup.py), and was somewhat unreliable (see issue python-control#37). This commit simplifies setup.py, always using setuptools, as recommended in the Python Packaging Guide: http://python-packaging-user-guide.readthedocs.org/en/latest/current.html The version information is now generated directly from tags in the git repository. Now, *before* running setup.py, one runs python make_version.py and this generates a file with the version information. This is copied from binstar (https://github.com/Binstar/binstar) and seems to work well.
To build the conda package: conda build conda-recipe Note that the version is automatically set according to the files generated by make_version.py, which is automatically run by the recipe
The majority of time in the Travis CI testing was spent installing slycot from source. (This also required installing a fortran compiler as part of the Travis build.) Installing from a binary saves a lot of time.
2 similar comments
If |
My comment above applies also if |
That's correct. And in that case, setup.py gives a UserWarning that 'dev' is an invalid version. This seems like a reasonable fallback to me, but do you have another suggestion? |
Another concern: counting commits since a tag will fail in the case of branching. E.g., a version string of "0.6.6.post6" could occur for two distinct commits that have a common ancestor. While you make the commit hash available via |
My basic argument against not including some--possibly incomplete--version number in the source tree is that Git becomes a required dependency of |
While we sort out the version discussion, is it worth separating out the two aspects of this request and re-issuing a separate pull request for all but the versioning part? Just a thought. |
@slivingston, the main reason I did things the way I did them is that I just copied what was done in binstar! I agree about the ambiguity of branches, but there shouldn't actually be any branching in the main releases, so that does not bother me. @murrayrm, I suppose it would be possible to separate this into two pull requests, but I would have to change the conda configuration, and I'd rather not go to extra work to replace that with something that, in my opinion, does not work as well. |
As I recall, the original mistake concerning the version on PyPI occurred because someone uploaded a release without discussing it, from a fork of the main repo. Indeed, examine the version number in setup.py of that fork and compare with the one on PyPI. Such could happen again, whether or not the version number is explicitly in the source tree. While Nonetheless, I think my concerns about dependence on Git and duplicate version strings for distinct (non-release) commits can be addressed empirically. That is, perhaps we should just merge this PR, and try it for awhile. By the way, besides |
All I meant was that in the new version, Note that the numpy stuff has been unreliable for us (e.g., #37), and the fix using the
Great. So unless anybody has any objections, I'll plan to do the following on Monday:
I'm not one of the developers on sourceforge, but I can send Richard or Scott the tarball or you could grab it from PyPI and upload to sourceforge. |
All sounds good to me. When we do a new release on SourceForge, we typically send out an e-mail to python-control-announce describing what is new in the release. Scott and I can handle that as well, with input from others if we need help in the descriptions. The e-mail for the last release is here: http://sourceforge.net/p/python-control/mailman/message/32135649/ |
Looking back, I see version 0.6a was released in Nov 2012, more than 2 years ago. There have been a lot of changes since then (including changing the version numbering scheme from 0.6d, etc, to 0.6.5, etc), so I'm thinking it makes sense to bump the version to 0.7.0. I'll plan on releasing this as 0.7.0 tomorrow, unless there are any objections. |
Sounds sensible. |
Add conda build recipe and improve version numbering
This pull request adds a "recipe" for building a conda package, and also improves how versions are specified for releases. Previously, one needed to specify the version number of each release manually in setup.py, and this has led to some confusion, as the version number did not necessarily correspond to tags in the git repository. With this pull request, version numbers are specified simply by pushing a tag to the git repo, as
The version numbers are then generated by a script
make_version.py
, which is run automatically by the conda recipe (but not bysetup.py
, so one still needs to remember to runmake_version.py
before uploading to PyPI). The version numbers are consistent with PEP 440, so for instance, a version that is 6 commits after the version tagged as 0.6.6 would be version "0.6.6.post6".The benefits of this approach are that the version numbers are specified only once (as a tag in the git repo), and they are guaranteed to correspond to the git repository. This avoids some confusion, as happened with v0.6.6 that is currently on PyPI (which I believe was built from @jgoppert's fork and includes PR #38, which has not been merged in, and is probably superfluous now).
This PR also changes the Travis CI build to test the conda recipe, and additionally to install slycot from a binary package I uploaded to binstar.org. This dramatically speeds up the travis build, which was spending most of its time compiling SLICOT from source.