Skip to content
Snippets Groups Projects

Add __version__ module-level attribute

Merged Matthew David Pitkin requested to merge matthew-pitkin/bilby:version into master
All threads resolved!

Merge request reports

Pipeline #34216 passed

Pipeline passed for 4e3bb176 on matthew-pitkin:version

Requires 2 approvals from Default.

Merged by Gregory AshtonGregory Ashton 6 years ago (Oct 15, 2018 8:39pm UTC)

Pipeline #34517 passed

Pipeline passed for 3b98cdf5 on master

Test coverage 71.00% from 0 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • mentioned in issue #209 (closed)

  • Hi @matthew-pitkin , thanks for looking into this. How does this interact with the .version file we have? The version file includes information about the current git hash and the state of the repository. Is this included in the __version__ attribute? I think this is important for code like bilby that most people tend to work with a development version (though it would be great if we eventually move to people using mainly the pip-tagged versions)

    Hi @gregory.ashton, at the moment my patch just does what is currently implemented and puts what's in the __version__ attribute into the .version file. But, we could do something more sophisticated. For example in astropyquery the have a __version__ that follows the format X.X.X.devXXXX (see PEP440), where the final four Xs are taken from the current git hash. From looking at their setup.py, when they want to draft a new release they just remove the .dev, create a release, and then add it back afterwards.

    Does that sound like a preferable route to take?

    Another option instead, or additionally to this, would be to add a local version identifier, that included information that is currently in the .version file, e.g.

    __version__ = '0.3.1+XXXXXXX.(UN)CLEAN.20YY.MM.DD.HH.MM.SS
    __version__ = '0.3.1.devXXXXXXX+(UN)CLEAN.20YY.MM.DD.HH.MM.SS

    Both the dev and "local version" option could mean developers end up with many different installed versions, so they'd have to be careful to uninstall current development versions before re-installing.

  • Another option is to have a date-based dev tag and then just the git hash in the local version identifer. The date-based dev tag seems to be what's used in LALSuite.

  • I'd be wary of something which means people could get confused about which version they are running.

    How about something like this patch (I've based it of your branch so you should be able to apply and see if it works). It puts the "version" number back into the setup.py, which I think is useful as its easier to remember to update it, the patches the __version__ in the init file as you had it. Could that work?

  • added 9 commits

    Compare with previous version

  • @gregory.ashton I've switched to your patch, so take a look what you think.

  • I'm personally happy with this. It adds the __version__ attribute nicely. And thanks for spotting those out of data version tags in the documentation!

    I'll approve, but I think you just need to fix the flake8 issue (imported re not used) then we can merge.

  • Gregory Ashton approved this merge request

    approved this merge request

  • added 1 commit

    Compare with previous version

  • I've fixed the import re issues, so this should be ready to go.

  • Matthew David Pitkin resolved all discussions

    resolved all discussions

  • added 1 commit

    Compare with previous version

  • Gregory Ashton approved this merge request

    approved this merge request

  • added 1 commit

    • 4e3bb176 - utils.py: use EnvironmentError

    Compare with previous version

  • Colm Talbot resolved all discussions

    resolved all discussions

  • Colm Talbot approved this merge request

    approved this merge request

  • Moritz Huebner approved this merge request

    approved this merge request

  • Gregory Ashton mentioned in commit 3b98cdf5

    mentioned in commit 3b98cdf5

  • Please register or sign in to reply
    Loading