Skip to content

Commit

Permalink
Merge remote-tracking branch 'blueprint/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Jan 4, 2022
2 parents 8a7686f + 5a0449f commit 2e44362
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issue-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v3
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: 30
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/py-dead-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: '3.8'

- name: "Cache pip"
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python-version: '3.8'

- name: "Cache pip"
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: "Cache pip"
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
python-version: 3.9

- name: "Cache pip"
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ See separate [license file](LICENSE.md) for full text.

[component]: https://github.com/Limych/ha-average
[commits-shield]: https://img.shields.io/github/commit-activity/y/Limych/ha-average.svg?style=popout
[commits]: https://github.com/Limych/ha-average/commits/master
[commits]: https://github.com/Limych/ha-average/commits/dev
[hacs-shield]: https://img.shields.io/badge/HACS-Default-orange.svg?style=popout
[hacs]: https://hacs.xyz
[exampleimg]: https://github.com/Limych/ha-average/raw/dev/example.png
Expand Down
34 changes: 26 additions & 8 deletions bin/gen_releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import logging
import os
import subprocess
from datetime import datetime
from typing import List, Optional
from typing import List, Optional, Tuple

from awesomeversion.match import is_pep440
from github import Github, GithubException, Repository, Tag
Expand All @@ -19,7 +19,7 @@ logging.basicConfig(level=logging.CRITICAL)

_LOGGER = logging.getLogger(__name__)

VERSION = "1.1.9"
VERSION = "1.2.0"

ROOT = os.path.dirname(os.path.abspath(f"{__file__}/.."))

Expand All @@ -28,6 +28,10 @@ BODY = """
{changes}
... and by bots:
{bot_changes}
## Links
- [If you like what I (@limych) do please consider sponsoring me on Patreon](https://www.patreon.com/join/limych?)
Expand Down Expand Up @@ -84,9 +88,11 @@ def get_period(repo: Repository, release: Optional[str] = None) -> List[datetime
return list(reversed(data[-2:]))


def gen_changes(repo: Repository, tag: Optional[str] = None) -> str:
def gen_changes(repo: Repository, tag: Optional[str] = None) -> Tuple[str, str, str]:
"""Generate list of commits."""
changes = ""
all_changes = ""
human_changes = ""
bot_changes = ""
period = get_period(repo, tag)
_LOGGER.debug("Period: %s", period)

Expand All @@ -106,11 +112,21 @@ def gen_changes(repo: Repository, tag: Optional[str] = None) -> str:
or "Fix errors" in msg
):
continue
changes += CHANGE.format(

change = CHANGE.format(
line=msg, link=commit.html_url, author=commit.author.login
)
all_changes += change
if "[bot]" not in commit.author.login:
human_changes += change
else:
bot_changes += change

return changes if changes != "" else NOCHANGE
return (
all_changes if all_changes != "" else NOCHANGE,
human_changes if human_changes != "" else NOCHANGE,
bot_changes if bot_changes != "" else NOCHANGE,
)


def _bump_release(release, bump_type):
Expand Down Expand Up @@ -199,7 +215,7 @@ def main():
_LOGGER.debug("Repo: %s", arguments.repo)
repo = github.get_repo(arguments.repo)
if arguments.release is None:
changes = gen_changes(repo)
changes = gen_changes(repo)[0]
_LOGGER.debug(changes)
if changes != NOCHANGE:
version = Version(get_release_tags(repo)[0].name.lstrip("v"))
Expand All @@ -218,10 +234,12 @@ def main():
tag = arguments.release.replace("refs/tags/", "")
_LOGGER.debug("Release tag: %s", tag)
version = Version(tag)
(_, human_changes, bot_changes) = gen_changes(repo, tag)
msg = BODY.format(
repo=arguments.repo,
version=str(version),
changes=gen_changes(repo, tag),
changes=human_changes,
bot_changes=bot_changes,
)
if arguments.dry_run:
print("Is prerelease:", version.is_prerelease)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/average/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Base component constants
NAME = "Average Sensor"
DOMAIN = "average"
VERSION = "2.2.0"
VERSION = "2.2.1-alpha"
ISSUE_URL = "https://github.com/Limych/ha-average/issues"

STARTUP_MESSAGE = f"""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/average/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "average",
"name": "Average Sensor",
"version": "2.2.0",
"version": "2.2.1-alpha",
"documentation": "https://github.com/Limych/ha-average",
"issue_tracker": "https://github.com/Limych/ha-average/issues",
"dependencies": [],
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements-test.txt
black==21.7b0
packaging==21.0
pre-commit~=2.14
PyGithub~=1.54
pyupgrade~=2.24
black==21.12b0
packaging==21.3
pre-commit~=2.16
PyGithub~=1.55
pyupgrade~=2.31
yamllint~=1.26
8 changes: 4 additions & 4 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-r requirements.txt
asynctest~=0.13
flake8~=3.9
flake8~=4.0
flake8-docstrings~=1.6
mypy==0.910
pylint~=2.10
mypy==0.930
pylint~=2.12
pylint-strict-informational==0.1
pytest~=6.2
pytest-cov~=2.10
pytest-cov~=2.12
pytest-homeassistant-custom-component>=0.4
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
homeassistant
homeassistant>=2021.7

0 comments on commit 2e44362

Please sign in to comment.