diff --git a/Makefile b/Makefile index ea5ba1963..ed704d6d8 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,12 @@ flake8: isort-check: isort --ac --check-only $(py_sources) +.PHONY: check-version +check-version: + bash ./extras/check_version.sh + .PHONY: check -check: flake8 isort-check mypy +check: flake8 isort-check mypy check-version # formatting: diff --git a/extras/check_version.sh b/extras/check_version.sh new file mode 100755 index 000000000..f972fd500 --- /dev/null +++ b/extras/check_version.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +OPENAPI_FILE="hathor/cli/openapi_files/openapi_base.json" +SRC_FILE="hathor/version.py" +PACKAGE_FILE="pyproject.toml" + +OPENAPI_VERSION=`grep "version\":" ${OPENAPI_FILE} | cut -d'"' -f4` +SRC_VERSION=`grep "__version__" ${SRC_FILE} | cut -d "'" -f2` +PACKAGE_VERSION=`grep '^version' ${PACKAGE_FILE} | cut -d '"' -f2` + +# For debugging: +# echo x${SRC_VERSION}x +# echo x${OPENAPI_VERSION}x +# echo x${PACKAGE_VERSION}x + +EXITCODE=0 + +if [[ x${PACKAGE_VERSION}x != x${SRC_VERSION}x ]]; then + echo "Version different in ${PACKAGE_FILE} and ${SRC_FILE}" + EXITCODE=-1 +fi + +if [[ x${PACKAGE_VERSION}x != x${OPENAPI_VERSION}x ]]; then + echo "Version different in ${PACKAGE_FILE} and ${OPENAPI_FILE}" + EXITCODE=-1 +fi + +if [[ ${EXITCODE} == 0 ]]; then + echo OK +fi +exit $EXITCODE diff --git a/hathor/cli/openapi_files/openapi_base.json b/hathor/cli/openapi_files/openapi_base.json index 02f00e179..52db6957f 100644 --- a/hathor/cli/openapi_files/openapi_base.json +++ b/hathor/cli/openapi_files/openapi_base.json @@ -7,7 +7,7 @@ ], "info": { "title": "Hathor API", - "version": "0.39.1" + "version": "0.40.0" }, "consumes": [ "application/json" diff --git a/hathor/version.py b/hathor/version.py index 44e5c7466..9cfcb4b4d 100644 --- a/hathor/version.py +++ b/hathor/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = '0.39.1' +__version__ = '0.40.0' diff --git a/pyproject.toml b/pyproject.toml index 482e854b2..97cd33591 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ [tool.poetry] name = "hathor" -version = "0.39.1" +version = "0.40.0" description = "Hathor Network full-node" authors = ["Hathor Team "] license = "Apache-2.0"