Skip to content

Commit

Permalink
Merge pull request #161 from dhs-ncats/improve_versioning
Browse files Browse the repository at this point in the history
Improve versioning
  • Loading branch information
jsf9k authored Apr 4, 2018
2 parents 94479fe + b72e7c5 commit 41f6f94
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
33 changes: 33 additions & 0 deletions bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#/usr/bin/env bash

# bump_version.sh (show|major|minor|patch|prerelease|build)

VERSION_FILE=pshtt/__init__.py

HELP_INFORMATION="bump_version.sh (show|major|minor|patch|prerelease|build|finalize)"

old_version=$(sed "s/__version__ = '\(.*\)'/\1/" $VERSION_FILE)

if [[ $# -ne 1 ]]
then
echo $HELP_INFORMATION
else
case $1 in
major|minor|patch|prerelease|build)
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
echo Changing version from $old_version to $new_version
sed -i "s/$old_version/$new_version/" $VERSION_FILE
;;
finalize)
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
echo Changing version from $old_version to $new_version
sed -i "s/$old_version/$new_version/" $VERSION_FILE
;;
show)
echo $old_version
;;
*)
echo $HELP_INFORMATION
;;
esac
fi
2 changes: 1 addition & 1 deletion pshtt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4.0-dev'
__version__ = '0.4.1'
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@

extras_require={
# 'dev': ['check-manifest'],
'test': [
'dev': [
'pytest',
'semver',
'tox',
'pytest'
],
},

Expand Down

0 comments on commit 41f6f94

Please sign in to comment.