dereneaton / ipyrad

Interactive assembly and analysis of RAD-seq data sets
http://ipyrad.readthedocs.io
GNU General Public License v3.0
72 stars 40 forks source link

In ipyrad/__init__ pull in version from git? #25

Closed isaacovercast closed 8 years ago

isaacovercast commented 8 years ago

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.

dereneaton commented 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.

isaacovercast commented 8 years ago

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.

dereneaton commented 8 years ago

Cool, seems easy. What do you think our procedure should be for tagging versions? major new features, major bug fixes, minor ones, anything?

isaacovercast commented 8 years ago

This is a better workflow. I haven't set it up yet, seems just as annoying as how we're doing it, kinda...

isaacovercast commented 8 years ago

Fixed. New workflow to add tags:

isaacovercast commented 8 years ago

Disregard. I updated setup.py to do some git magic. The new workflow is:

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.

isaacovercast commented 8 years ago

Not ideal, but best i could do.. turns out to be a tricky problem, lots of race conditions.

dereneaton commented 8 years ago

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
dereneaton commented 8 years ago

Or did you mean that I should run pip install -e . ?

dereneaton commented 8 years ago

I pushed changes to master after tagging 0.1.5 but the tag doesn't seem to have worked. Must have screwed something up...

dereneaton commented 8 years ago

nvm

dereneaton commented 8 years ago

I'm satisfied with this if you want to close it.

isaacovercast commented 8 years ago

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.