Skip to content

Commit

Permalink
Merge pull request #379 from cisagov/improvement/change_version_file_…
Browse files Browse the repository at this point in the history
…format

Change the format of the version tracking file
  • Loading branch information
jsf9k authored Dec 9, 2024
2 parents 1d66605 + 13c5ef6 commit 92638b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ VERSION_FILE=src/version.txt

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

old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)
old_version=$(< "$VERSION_FILE")
# Comment out periods so they are interpreted as periods and don't
# just match any character
old_version_regex=${old_version//\./\\\.}
Expand Down
2 changes: 1 addition & 1 deletion src/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0"
2.0.0
4 changes: 1 addition & 3 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
)
def test_release_version():
"""Verify that release tag version agrees with the module version."""
pkg_vars = {}
with open(VERSION_FILE) as f:
exec(f.read(), pkg_vars) # nosec
project_version = pkg_vars["__version__"]
project_version = f.read().strip()
assert (
GITHUB_RELEASE_TAG == f"v{project_version}"
), "GITHUB_RELEASE_TAG does not match the project version"

0 comments on commit 92638b8

Please sign in to comment.