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 diff --git a/pyproject.toml b/pyproject.toml index dc88185..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" @@ -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/_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" 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__