Closed isaacovercast closed 8 years ago
Is this possible? I stole most of setup.py from looking at other modules, and it seemed most others just write a string for the version. Tagging would be classy, though. I'm not up to speed on tagging yet, need to read more.
This is the quick and dirty way.
mytag = subprocess.check_output(["git", "describe", "--tags"]).split("-")[0]
There's python libraries for git that does it "right" but it seems stupid to include a library just for this one tiny feature. I think the easy way is better here.
Cool, seems easy. What do you think our procedure should be for tagging versions? major new features, major bug fixes, minor ones, anything?
This is a better workflow. I haven't set it up yet, seems just as annoying as how we're doing it, kinda...
Fixed. New workflow to add tags:
git tag -a <newversion>
git push origin <newversion>
python setup.py
<- bumps the version in init.pygit add ipyrad/__init__.py
git push
Disregard. I updated setup.py to do some git
magic. The new workflow is:
git tag -a <newversion>
git push origin <newversion>
python setup.py
The new version of setup.py autodetects the current ipyrad/init.py version, pulls down from git the current version tag, if they differ setup.py updates init.py, and does a git add/commit with a default commit message indicating the updated version number.
Not ideal, but best i could do.. turns out to be a tricky problem, lots of race conditions.
I got an error when running setup.py. Should there be an argument to it? Also, do we have to worry that running setup.py will interfere with our pip or conda installation?
deren@tinus:~/Documents/ipyrad$ python setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
Or did you mean that I should run pip install -e .
?
I pushed changes to master after tagging 0.1.5 but the tag doesn't seem to have worked. Must have screwed something up...
nvm
I'm satisfied with this if you want to close it.
ipyrad_update_version.py now holds the code for updating the version, really it's just a wrapper script around a couple commands so it's pretty simple. Pulled all the git code out of setup.py and i feel much better now.
The conda package build pulls in codebase associated with the current git tag. I think this is probably a good strategy, to rely on tagging to milestone stable versions. There should be a way to pull in the current git tag inside ipyrad/init, I'm assuming, so we don't have to set it by hand.