From d9765d2058f3d4d7be317257041199fa53b01b79 Mon Sep 17 00:00:00 2001 From: Callmeiks Date: Sun, 12 Apr 2026 16:50:51 -0700 Subject: [PATCH 1/3] fix: use grep instead of python import for version check in release workflow Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d50c67d..aa1bd8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,11 +19,7 @@ jobs: - name: Verify version matches tag run: | TAG="${GITHUB_REF#refs/tags/v}" - PKG_VERSION=$(python -c " -import re, pathlib -text = pathlib.Path('src/tikhub/_version.py').read_text() -print(re.search(r'__version__\s*=\s*[\"'\''](.*?)[\"'\'']', text).group(1)) -") + PKG_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' src/tikhub/_version.py) if [ "$TAG" != "$PKG_VERSION" ]; then echo "::error::tag $TAG does not match package version $PKG_VERSION" exit 1 From bc120350e6ae8460d89c7edc0c8b7c2044c06b54 Mon Sep 17 00:00:00 2001 From: Callmeiks Date: Sun, 12 Apr 2026 17:37:57 -0700 Subject: [PATCH 2/3] feat: make typer a core dependency so CLI works out of the box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users no longer need pip install "tikhub[cli]" — the tikhub command is available immediately after pip install tikhub. Co-Authored-By: Claude Opus 4.6 (1M context) --- pyproject.toml | 2 +- src/tikhub/cli/__init__.py | 8 ++------ src/tikhub/cli/main.py | 7 +------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dc88185..b7b3f12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,10 +44,10 @@ dependencies = [ "httpx>=0.27", "pydantic>=2.6", "anyio>=4.0", + "typer>=0.12", ] [project.optional-dependencies] -cli = ["typer>=0.12"] docs = [ "mkdocs>=1.6", "mkdocs-material>=9.5", diff --git a/src/tikhub/cli/__init__.py b/src/tikhub/cli/__init__.py index 2c21604..9748bb0 100644 --- a/src/tikhub/cli/__init__.py +++ b/src/tikhub/cli/__init__.py @@ -1,10 +1,6 @@ -"""Optional command-line wrapper for the TikHub SDK. +"""Command-line wrapper for the TikHub SDK. -Install with the ``cli`` extra:: - - pip install "tikhub[cli]" - -Then:: +Usage:: tikhub health tikhub fetch https://v.douyin.com/abc/ diff --git a/src/tikhub/cli/main.py b/src/tikhub/cli/main.py index b445634..81baf55 100644 --- a/src/tikhub/cli/main.py +++ b/src/tikhub/cli/main.py @@ -12,12 +12,7 @@ import sys from typing import Any, Callable -try: - import typer -except ImportError as exc: # pragma: no cover - raise ImportError( - "The CLI requires the 'cli' extra. Install with: pip install 'tikhub[cli]'" - ) from exc +import typer from tikhub import TikHub, TikHubError, __version__ From 0140a525b6f2415e972d697a90718d1a8840f4a0 Mon Sep 17 00:00:00 2001 From: Callmeiks Date: Sun, 12 Apr 2026 17:39:12 -0700 Subject: [PATCH 3/3] bump: v2.1.1 Co-Authored-By: Claude Opus 4.6 (1M context) --- pyproject.toml | 2 +- src/tikhub/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b7b3f12..c2e951f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "tikhub" -version = "2.1.0" +version = "2.1.1" description = "Modern Python SDK for the TikHub social-media data API." readme = "README.md" license = "MIT" diff --git a/src/tikhub/_version.py b/src/tikhub/_version.py index c32cc59..67ad286 100644 --- a/src/tikhub/_version.py +++ b/src/tikhub/_version.py @@ -1,3 +1,3 @@ """Single source of truth for the SDK version.""" -__version__ = "2.1.0" +__version__ = "2.1.1"