Skip to content

Commit

Permalink
Change the format of the version tracking file
Browse files Browse the repository at this point in the history
There is no reason to have any information but the version in the
version tracking file for Packer template projects. The current format
is simply an artifact of mirroring things over from the
cisagov/skeleton-python-library project.
  • Loading branch information
mcdonnnj committed Oct 10, 2024
1 parent d44181d commit 13c5ef6
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 13c5ef6

Please sign in to comment.