77from datetime import datetime
88
99
10+ def get_current_version ():
11+ """Read the current package version from datafog/__about__.py."""
12+ try :
13+ with open ("datafog/__about__.py" ) as f :
14+ match = re .search (r'^__version__ = "([^"]+)"' , f .read (), re .M )
15+ return match .group (1 ) if match else None
16+ except OSError :
17+ return None
18+
19+
1020def get_latest_tag ():
1121 """Get the latest git tag."""
1222 try :
@@ -65,6 +75,7 @@ def generate_changelog(beta=False, alpha=False):
6575 """Generate changelog content."""
6676 latest_tag = get_latest_tag ()
6777 commits = get_commits_since_tag (latest_tag )
78+ current_version = get_current_version ()
6879
6980 if not commits :
7081 return "No changes since last release."
@@ -85,6 +96,32 @@ def generate_changelog(beta=False, alpha=False):
8596 changelog = "# What's New\n \n "
8697 changelog += f"*Released: { datetime .now ().strftime ('%Y-%m-%d' )} *\n \n "
8798
99+ if not alpha and not beta and current_version == "4.4.0" :
100+ changelog += "## Python 3.13 Support Scope\n \n "
101+ changelog += (
102+ "Python 3.13 support is certified for the core SDK and CLI: "
103+ "`pip install datafog` and `pip install datafog[cli]`.\n \n "
104+ )
105+ changelog += (
106+ "Optional extras including `nlp`, `nlp-advanced`, `ocr`, "
107+ "`distributed`, and `all` are available but not yet certified on "
108+ "Python 3.13. They will be validated separately based on user "
109+ "demand.\n \n "
110+ )
111+ changelog += "## v5 Migration Bridge\n \n "
112+ changelog += (
113+ "This release adds the v5-preview top-level APIs `datafog.scan`, "
114+ "`datafog.redact`, and `datafog.protect` while keeping the legacy "
115+ "`datafog.detect` and `datafog.process` APIs working with targeted "
116+ "migration warnings.\n \n "
117+ )
118+ changelog += "## Privacy Defaults\n \n "
119+ changelog += (
120+ "Telemetry is now opt-in. DataFog does not send telemetry unless "
121+ "`DATAFOG_TELEMETRY=1` is explicitly set. `DATAFOG_NO_TELEMETRY=1` "
122+ "and `DO_NOT_TRACK=1` continue to force telemetry off.\n \n "
123+ )
124+
88125 if categories ["features" ]:
89126 changelog += "## 🚀 New Features\n "
90127 for commit in categories ["features" ]:
0 commit comments