Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Add script to make sure CHANGELOG is always in sync with `__version__` * Fix version * Change file permission * Change head by sed

authored by Marcelo Trylesinski · committed by GitHub · parent 5af6123 · Browse files · 2 files+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−0 removed

  • other:+12 added−0 removed

2 files+12 added−0 removed

modified:scripts/check+1 added
6 unmodified lines
7export SOURCE_FILES="httpx tests"89set -x1011./scripts/sync-version12${PREFIX}black --check --diff --target-version=py36 $SOURCE_FILES13${PREFIX}flake8 $SOURCE_FILES14${PREFIX}mypy $SOURCE_FILES15${PREFIX}isort --check --diff --project=httpx $SOURCE_FILES
added:scripts/sync-version+11 added
1#!/bin/sh -e23SEMVER_REGEX="([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?"4CHANGELOG_VERSION=$(grep -o -E $SEMVER_REGEX CHANGELOG.md | sed -n 2p)5VERSION=$(grep -o -E $SEMVER_REGEX httpx/__version__.py | head -1)6echo "CHANGELOG_VERSION: $CHANGELOG_VERSION"7echo "VERSION: $VERSION"8if [ "$CHANGELOG_VERSION" != "$VERSION" ]; then9 echo "Version in changelog does not match version in httpx/__version__.py!"10 exit 111fi