Skip to content

Commit

Permalink
chore: bump and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Oct 4, 2021
1 parent 523de58 commit 1dea7c4
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 56 deletions.
8 changes: 8 additions & 0 deletions 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
Expand Down
37 changes: 37 additions & 0 deletions 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()
3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,7 @@
{
"scripts": {
"release": "standard-version"
"release": "standard-version",
"bump": "python bump.py"
},
"standard-version": {
"skip": {
Expand Down
5 changes: 1 addition & 4 deletions 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"
4 changes: 2 additions & 2 deletions popmon/visualization/report_generator.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
)
)
Expand Down
51 changes: 2 additions & 49 deletions setup.py
@@ -1,68 +1,21 @@
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()

# read the contents of abstract file
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",
Expand Down

0 comments on commit 1dea7c4

Please sign in to comment.