Skip to content

Commit 312f42d

Browse files
author
Thordata
committed
Release 1.8.1: fix browser optional dependency test collection
1 parent 637dc9c commit 312f42d

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.8.1] - 2026-02-XX
6+
7+
### Fixed
8+
- **Browser Optional Dependency**: Fixed test collection failure when Playwright is not installed
9+
- `thordata.browser` now always exports `BrowserError` and `BrowserConnectionError`
10+
- `BrowserSession` is exported only when Playwright is available
11+
- Browser tests avoid importing `BrowserSession` when Playwright is missing
12+
513
## [1.8.0] - 2026-02-XX
614

715
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "thordata-sdk"
8-
version = "1.8.0"
8+
version = "1.8.1"
99
description = "The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network."
1010
readme = "README.md"
1111
requires-python = ">=3.9"

src/thordata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Universal Scraping API (Web Unlocker), and Web Scraper API.
66
"""
77

8-
__version__ = "1.8.0"
8+
__version__ = "1.8.1"
99
__author__ = "Thordata Developer Team/Kael Odin"
1010
__email__ = "support@thordata.com"
1111

src/thordata/browser/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
from __future__ import annotations
88

9+
from .exceptions import BrowserConnectionError, BrowserError
10+
911
try:
10-
from .exceptions import BrowserConnectionError, BrowserError
1112
from .session import BrowserSession
1213

1314
__all__ = ["BrowserSession", "BrowserError", "BrowserConnectionError"]
1415
except ImportError:
15-
# Playwright not installed
16-
__all__ = []
16+
# Playwright not installed - BrowserSession not available
17+
__all__ = ["BrowserError", "BrowserConnectionError"]

tests/test_browser.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
PLAYWRIGHT_AVAILABLE = False
1313

1414
from thordata import AsyncThordataClient
15-
from thordata.browser import BrowserConnectionError, BrowserError, BrowserSession
15+
16+
if PLAYWRIGHT_AVAILABLE:
17+
from thordata.browser import BrowserConnectionError, BrowserError, BrowserSession
18+
else:
19+
from thordata.browser import BrowserConnectionError, BrowserError
1620

1721

1822
@pytest.mark.skipif(not PLAYWRIGHT_AVAILABLE, reason="Playwright not installed")

0 commit comments

Comments
 (0)