Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/blueprint/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Oct 14, 2024
2 parents 2605015 + 7c16af0 commit f0a7bb6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@

- [ ] The code change is tested and works locally.
- [ ] There is no commented out code in this PR.
- [ ] The code has been formatted using Black (`black --fast custom_components`)
- [ ] The code has been formatted using Ruff (`python3 -m ruff format custom_components`)
- [ ] The code quality has been checked using Ruff (`python3 -m ruff check custom_components --fix`)

If user exposed functionality or configuration variables are added/changed:

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff-format
files: ^(custom_components|bin|tests)/.+\.py$
- id: ruff
args: [ --fix ]
files: ^(custom_components|bin|tests)/.+\.py$
- id: ruff-format
files: ^(custom_components|bin|tests)/.+\.py$
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-r requirements-test.txt
black~=24.8
packaging~=24.1
pre-commit~=4.0
PyGithub~=2.4
Expand Down
20 changes: 11 additions & 9 deletions scripts/gen_releasenotes
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""Helper script to generate release notes."""

import argparse
from datetime import datetime
import logging
import os
import re
import subprocess
from typing import List, Optional, Tuple
from datetime import datetime

from github import Github, GithubException, Repository, Tag
from packaging.version import Version
Expand Down Expand Up @@ -66,7 +66,7 @@ def get_commits(repo: Repository, since: datetime, until: datetime):
return reversed(list(commits)[:-1])


def get_release_tags(repo: Repository) -> List[Tag.Tag]:
def get_release_tags(repo: Repository) -> list[Tag.Tag]:
"""Get list of all release tags from repository."""
tags = list(
filter(lambda tag: is_pep440(tag.name.lstrip("v")), list(repo.get_tags()))
Expand All @@ -76,7 +76,7 @@ def get_release_tags(repo: Repository) -> List[Tag.Tag]:
return tags


def get_period(repo: Repository, release: Optional[str] = None) -> List[datetime]:
def get_period(repo: Repository, release: str | None = None) -> list[datetime]:
"""Return time period for release notes."""
data = [datetime.now()]
dateformat = "%a, %d %b %Y %H:%M:%S GMT"
Expand All @@ -98,7 +98,7 @@ 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) -> Tuple[str, str, str]:
def gen_changes(repo: Repository, tag: str | None = None) -> tuple[str, str, str]:
"""Generate list of commits."""
all_changes = ""
human_changes = ""
Expand All @@ -124,13 +124,15 @@ def gen_changes(repo: Repository, tag: Optional[str] = None) -> Tuple[str, str,
continue

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

return (
all_changes if all_changes != "" else NOCHANGE,
Expand Down
3 changes: 2 additions & 1 deletion scripts/update_requirements
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""Helper script to update requirements."""

import json
import os
import sys
Expand Down Expand Up @@ -28,7 +29,7 @@ def get_package(requre: str) -> str:
harequire = ["homeassistant"]
request = requests.get(
"https://raw.githubusercontent.com/home-assistant/core/dev/requirements.txt",
timeout=10
timeout=10,
)
request = request.text.split("\n")
for req in request:
Expand Down

0 comments on commit f0a7bb6

Please sign in to comment.