Skip to content

Commit 6fba298

Browse files
shixishclaude
andcommitted
Bump to 0.2.1; derive __version__ from package metadata
0.2.0 shipped with a hardcoded __version__ = "0.1.0" that nothing kept in sync with pyproject.toml. Read the version from importlib.metadata so the package and module versions can never drift again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 00d4ec3 commit 6fba298

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "diffbot-python"
7-
version = "0.2.0"
7+
version = "0.2.1"
88
description = "Python client library for Diffbot APIs"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/diffbot/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
diffbot - Python client library for the Diffbot APIs.
33
"""
44

5-
__version__ = "0.1.0"
5+
from importlib.metadata import PackageNotFoundError, version as _version
6+
7+
try:
8+
__version__ = _version("diffbot-python")
9+
except PackageNotFoundError: # not installed (e.g. running from a source tree)
10+
__version__ = "0.0.0"
611

712
from ._auth import resolve_token
813
from .client import Diffbot, DiffbotAsync

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)