mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-07 22:28:47 -05:00
refactor: use datetime.UTC alias instead of timezone.utc
Python 3.11 introduced datetime.UTC as a cleaner alias for datetime.timezone.utc. Both build.py and fetch_github_stars.py are updated to use the shorter form. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import TypedDict
|
||||
|
||||
@@ -189,7 +189,7 @@ def build(repo_root: str) -> None:
|
||||
total_entries=total_entries,
|
||||
total_categories=len(categories),
|
||||
repo_stars=repo_stars,
|
||||
build_date=datetime.now(timezone.utc).strftime("%B %d, %Y"),
|
||||
build_date=datetime.now(UTC).strftime("%B %d, %Y"),
|
||||
sponsors=sponsors,
|
||||
),
|
||||
encoding="utf-8",
|
||||
|
||||
@@ -5,7 +5,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
@@ -110,7 +110,7 @@ def main() -> None:
|
||||
print(f"Found {len(current_repos)} GitHub repos in README.md")
|
||||
|
||||
cache = load_stars(CACHE_FILE)
|
||||
now = datetime.now(timezone.utc)
|
||||
now = datetime.now(UTC)
|
||||
|
||||
# Prune entries not in current README
|
||||
pruned = {k: v for k, v in cache.items() if k in current_repos}
|
||||
|
||||
Reference in New Issue
Block a user