Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #228 from NifTK/227-untagged-archive-returns-no-ve…
Browse files Browse the repository at this point in the history
…rsion-string

Untagged archive now returns full revision ID as version string (fixes #227)
  • Loading branch information
wyli authored Sep 13, 2018
2 parents 1bccbf8 + fcd6f4d commit 85d8af4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ testjob:
- mkdir $check_version_zip
- git archive --format=tar HEAD | (cd $check_version_zip && tar xf -)
- cd $check_version_zip
- python net_segment.py --version 2>&1 | grep -E 'NiftyNet.*version.*unknown'
- python -c 'import niftynet; print(niftynet.__version__)' | grep -E 'NiftyNet.*version.*unknown'
- python net_segment.py --version 2>&1 | grep -v 'unknown'
- python -c 'import niftynet; print(niftynet.__version__)' | grep -v 'unknown'
- cd $niftynet_dir
- rm -rf $check_version_zip
- unset check_version_zip
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* `niftynet.engine`: improved core functions
- IO modules based on `tf.data.Dataset` (breaking changes)
- Decoupled the engine and event handlers
* Migrated the code repository, model zoo, and [niftynet.io](http://niftynet.io) source code to [github.com/niftk]
(https://github.com/niftk).
* Migrated the code repository, model zoo, and [niftynet.io](http://niftynet.io) source code to
[github.com/niftk](https://github.com/niftk).

## [0.3.0] - 2018-05-15
### Added
Expand Down
5 changes: 5 additions & 0 deletions niftynet/utilities/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def get_niftynet_version():
version_info = get_versions()
if version_info['error'] is None:
version_string = version_info['version']
elif 'full-revisionid' in version_info:
if version_info['full-revisionid']:
version_string = '{} ({})'.format(
version_info['full-revisionid'], version_info['error']
)
except:
pass # version_string is None by default

Expand Down

0 comments on commit 85d8af4

Please sign in to comment.