diff --git a/CHANGELOG.md b/CHANGELOG.md index be815364..80a29fd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Release notes + +## [v0.4.3](https://github.com/ing-bank/popmon/compare/v0.4.2...v0.4.3) (2021-10-04) + + +### 🐛 Bug fixes + +* fix too restrictive numpy integer check in hist_stitcher ([c162f11](https://github.com/ing-bank/popmon/commits/c162f11a68a6d8aaf82cb9fd8365f018cbc2feb6)) + ## [Version 0.4.2](https://github.com/ing-bank/popmon/compare/v0.4.1...v0.4.2) (2021-08-25) ### ⬆️ Dependencies diff --git a/bump.py b/bump.py new file mode 100644 index 00000000..d44205cd --- /dev/null +++ b/bump.py @@ -0,0 +1,37 @@ +import re +from pathlib import Path + +MAJOR = 0 +REVISION = 4 +PATCH = 3 +VERSION = f"{MAJOR}.{REVISION}.{PATCH}" + + +def write_version_py(filename: str = "popmon/version.py") -> None: + """Write package version to version.py. + + This will ensure that the version in version.py is in sync with us. + + :param filename: The version.py to write too. + :type filename: str + """ + # Do not modify the indentation of version_str! + version_str = f"""\"\"\"THIS FILE IS AUTO-GENERATED BY SETUP.PY.\"\"\" + +version = \"{VERSION:s}\" +""" + + with open(filename, "w") as version_file: + version_file.write(version_str) + + +def update_setup_py(filename="setup.py"): + contents = Path(filename).read_text() + contents = re.sub( + r'version="[0-9]+\.[0-9]+\.[0-9]+[A-Za-z]*",', f'version="{VERSION}",', contents + ) + Path(filename).write_text(contents) + + +write_version_py() +update_setup_py() diff --git a/package.json b/package.json index a77283e6..24139e98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "scripts": { - "release": "standard-version" + "release": "standard-version", + "bump": "python bump.py" }, "standard-version": { "skip": { diff --git a/popmon/version.py b/popmon/version.py index c116c533..ee4e2c89 100644 --- a/popmon/version.py +++ b/popmon/version.py @@ -1,6 +1,3 @@ """THIS FILE IS AUTO-GENERATED BY SETUP.PY.""" -name = "popmon" -version = "0.4.2" -full_version = "0.4.2" -release = True +version = "0.4.3" diff --git a/popmon/visualization/report_generator.py b/popmon/visualization/report_generator.py index ae17bdf6..eec0f158 100644 --- a/popmon/visualization/report_generator.py +++ b/popmon/visualization/report_generator.py @@ -22,7 +22,7 @@ from ..base import Module from ..resources import templates_env -from ..version import name, version +from ..version import version class ReportGenerator(Module): @@ -54,7 +54,7 @@ def transform(self, datastore): datastore[self.store_key] = htmlmin.minify( templates_env( filename="core.html", - generator=f"{name} {version}", + generator=f"popmon {version}", sections=sections_html, ) ) diff --git a/setup.py b/setup.py index 1350d295..03dbe977 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,5 @@ from setuptools import find_packages, setup -NAME = "popmon" - -MAJOR = 0 -REVISION = 4 -PATCH = 3 -DEV = False -# NOTE: also update version at: README.rst - with open("requirements.txt") as f: REQUIREMENTS = f.read().splitlines() @@ -15,54 +7,15 @@ with open("README.rst", encoding="utf-8") as f: long_description = f.read() -VERSION = "{major}.{revision}.{patch}".format( - major=MAJOR, revision=REVISION, patch=PATCH -) -FULL_VERSION = VERSION -if DEV: - FULL_VERSION += ".dev" - with open("requirements-test.txt") as f: - REQUIREMENTS += f.read().splitlines() - - -def write_version_py(filename: str = "popmon/version.py") -> None: - """Write package version to version.py. - - This will ensure that the version in version.py is in sync with us. - - :param filename: The version.py to write too. - :type filename: str - """ - # Do not modify the indentation of version_str! - version_str = """\"\"\"THIS FILE IS AUTO-GENERATED BY SETUP.PY.\"\"\" - -name = \"{name!s}\" -version = \"{version!s}\" -full_version = \"{full_version!s}\" -release = {is_release!s} -""" - - with open(filename, "w") as version_file: - version_file.write( - version_str.format( - name=NAME.lower(), - version=VERSION, - full_version=FULL_VERSION, - is_release=not DEV, - ) - ) - def setup_package() -> None: """The main setup method. It is responsible for setting up and installing the package. """ - write_version_py() - setup( - name=NAME, - version=VERSION, + name="popmon", + version="0.4.3", url="https://github.com/ing-bank/popmon", license="MIT", author="ING Wholesale Banking Advanced Analytics",