Skip to content

Commit f848e6b

Browse files
committed
fix: Fixes to handle the new extra deps group
1 parent c7b9d45 commit f848e6b

6 files changed

Lines changed: 8 additions & 23 deletions

File tree

scrapling/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
try:
1212
from click import command, option, Choice, group, argument
13-
except ImportError:
14-
raise ImportError(
13+
except (ImportError, ModuleNotFoundError) as e:
14+
raise ModuleNotFoundError(
1515
"You need to install scrapling with any of the extras to enable Shell commands. See: https://scrapling.readthedocs.io/en/latest/#installation"
16-
)
16+
) from e
1717

1818
__OUTPUT_FILE_HELP__ = "The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively."
1919
__PACKAGE_DIR__ = Path(__file__).parent

scrapling/core/ai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pydantic import BaseModel, Field
55

66
from scrapling.core.shell import Convertor
7-
from scrapling.engines.toolbelt import Response as _ScraplingResponse
7+
from scrapling.engines.toolbelt.custom import Response as _ScraplingResponse
88
from scrapling.fetchers import (
99
Fetcher,
1010
FetcherSession,

scrapling/engines/static.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@
2424
Any,
2525
)
2626

27-
from .toolbelt import (
28-
Response,
29-
generate_headers,
30-
__default_useragent__,
31-
)
27+
from .toolbelt.custom import Response
3228
from .toolbelt.convertor import ResponseFactory
33-
from .toolbelt.fingerprints import generate_convincing_referer
29+
from .toolbelt.fingerprints import generate_convincing_referer, generate_headers, __default_useragent__
3430

3531
_UNSET = object()
3632

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
from .custom import (
2-
BaseFetcher,
3-
Response,
4-
StatusText,
5-
get_variable_name,
6-
)
7-
from .fingerprints import (
8-
generate_headers,
9-
get_os_name,
10-
__default_useragent__,
11-
)
1+

scrapling/engines/toolbelt/custom.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
from functools import lru_cache
6-
from email.message import Message
76

87
from scrapling.core.utils import log
98
from scrapling.core._types import (

scrapling/fetchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
AsyncDynamicSession,
1818
AsyncStealthySession,
1919
)
20-
from scrapling.engines.toolbelt import BaseFetcher, Response
20+
from scrapling.engines.toolbelt.custom import BaseFetcher, Response
2121

2222
__FetcherClientInstance__ = _FetcherClient()
2323
__AsyncFetcherClientInstance__ = _AsyncFetcherClient()

0 commit comments

Comments
 (0)