Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to make sure CHANGELOG is always in sync with __version__ #2297

Merged
merged 6 commits into from
Aug 20, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/check
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export SOURCE_FILES="httpx tests"

set -x

./scripts/sync-version
${PREFIX}black --check --diff --target-version=py36 $SOURCE_FILES
${PREFIX}flake8 $SOURCE_FILES
${PREFIX}mypy $SOURCE_FILES
Expand Down
11 changes: 11 additions & 0 deletions scripts/sync-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -e

SEMVER_REGEX="([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?"
CHANGELOG_VERSION=$(grep -o -E $SEMVER_REGEX CHANGELOG.md | sed -n 2p)
VERSION=$(grep -o -E $SEMVER_REGEX httpx/__version__.py | head -1)
echo "CHANGELOG_VERSION: $CHANGELOG_VERSION"
echo "VERSION: $VERSION"
if [ "$CHANGELOG_VERSION" != "$VERSION" ]; then
echo "Version in changelog does not match version in httpx/__version__.py!"
exit 1
fi