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

Commit 85d8af4

Browse files
authored
Merge pull request #228 from NifTK/227-untagged-archive-returns-no-version-string
Untagged archive now returns full revision ID as version string (fixes #227)
2 parents 1bccbf8 + fcd6f4d commit 85d8af4

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ testjob:
8888
- mkdir $check_version_zip
8989
- git archive --format=tar HEAD | (cd $check_version_zip && tar xf -)
9090
- cd $check_version_zip
91-
- python net_segment.py --version 2>&1 | grep -E 'NiftyNet.*version.*unknown'
92-
- python -c 'import niftynet; print(niftynet.__version__)' | grep -E 'NiftyNet.*version.*unknown'
91+
- python net_segment.py --version 2>&1 | grep -v 'unknown'
92+
- python -c 'import niftynet; print(niftynet.__version__)' | grep -v 'unknown'
9393
- cd $niftynet_dir
9494
- rm -rf $check_version_zip
9595
- unset check_version_zip

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2828
* `niftynet.engine`: improved core functions
2929
- IO modules based on `tf.data.Dataset` (breaking changes)
3030
- Decoupled the engine and event handlers
31-
* Migrated the code repository, model zoo, and [niftynet.io](http://niftynet.io) source code to [github.com/niftk]
32-
(https://github.com/niftk).
31+
* Migrated the code repository, model zoo, and [niftynet.io](http://niftynet.io) source code to
32+
[github.com/niftk](https://github.com/niftk).
3333

3434
## [0.3.0] - 2018-05-15
3535
### Added

niftynet/utilities/versioning.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ def get_niftynet_version():
3636
version_info = get_versions()
3737
if version_info['error'] is None:
3838
version_string = version_info['version']
39+
elif 'full-revisionid' in version_info:
40+
if version_info['full-revisionid']:
41+
version_string = '{} ({})'.format(
42+
version_info['full-revisionid'], version_info['error']
43+
)
3944
except:
4045
pass # version_string is None by default
4146

0 commit comments

Comments
 (0)