Enable flake8-datetimez linting rules (#267)

See https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz.
This commit is contained in:
Marc Wrobel
2023-12-30 11:20:51 +01:00
parent 54e7091fd2
commit 798c298c59
10 changed files with 34 additions and 26 deletions

View File

@@ -172,7 +172,8 @@ def update_product(name: str, product_dir: Path, releases_dir: Path) -> None:
# Print all unmatched versions released in the last 30 days
if len(product.unmatched_versions) != 0:
for version, date in product.unmatched_versions.items():
days_since_release = (datetime.date.today() - date).days
today = datetime.datetime.now(tz=datetime.timezone.utc).date()
days_since_release = (today - date).days
if days_since_release < 30:
logging.warning(f"{name}:{version} ({date}) not included")
github_output(f"{name}:{version} ({date})\n")