You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f41e9c1
Browse filesBrowse the repository at this point in the historyBrowse files
Move runtime dependencies into optional extras (zim, image, video, download, filesystem, html, rewriting, i18n, all), keep beartype as the only base dependency, and raise actionable ImportErrors when an extra is missing. Resolve cross-feature imports at call time so each extra stands alone. Add metadata/import tests, a CI matrix, docs, and changelog entries.
Fixes#244
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
12
+
- Optional dependency groups `zim`, `image`, `video`, `download`, `filesystem`, `html`, `rewriting`, `i18n` and `all`; the base install now only requires `beartype` (#244)
13
+
- Missing optional dependencies now raise an `ImportError` naming the extra to install (#244)
14
+
15
+
### Changed
16
+
17
+
- Cross-feature imports are now resolved where they are used, so each extra only needs its own dependencies (#244)
18
+
19
+
### Fixed
20
+
21
+
- The `rewriting` extra now declares `tinycss2` explicitly instead of relying on it being pulled in through `CairoSVG` (#244)
Copy file name to clipboardExpand all lines: README.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,33 +34,49 @@ See documentation at [Read the Docs](https://python-scraperlib.readthedocs.io/)
34
34
35
35
# Dependencies
36
36
37
-
Most dependencies are installed automatically by pip (from PyPI by default). The following system packages may be required depending on which features you use:
37
+
The base install only pulls in `beartype`. Install the extras for the features you use:
38
38
39
-
-**libmagic** — required for file type detection (used in most scrapers)
40
-
-**wget** — required only for `zimscraperlib.download` functions
41
-
-**FFmpeg** — required only for video processing functions
42
-
-**gifsicle** (>=1.92) — required only for GIF optimization
43
-
-**libcairo** — required only for SVG-to-PNG conversion
44
-
-**libzim** — auto-installed via PyPI, not available on Windows
45
-
-**Pillow** — auto-installed via PyPI; pre-built wheels are used by default and no system image libraries are needed. Only if you need to build Pillow from source should you install additional system libraries — see [Pillow's build documentation](https://pillow.readthedocs.io/en/latest/installation/building-from-source.html) for details.
46
-
> **Note:** To run the full test suite, all system dependencies listed above must be installed.
39
+
```sh
40
+
python -m pip install 'zimscraperlib[zim,image]'
41
+
python -m pip install 'zimscraperlib[all]'
42
+
```
43
+
44
+
Importing a module whose extra is missing raises an `ImportError` naming the extra to install.
45
+
46
+
| Extra | Python dependencies for | System dependencies |
47
+
| --- | --- | --- |
48
+
|`zim`|`zimscraperlib.zim`| none (`libzim` ships wheels, except on unsupported platforms) |
49
+
|`image`|`zimscraperlib.image`| libcairo for SVG conversion, gifsicle (>=1.92) for GIF optimization |
50
+
|`video`|`zimscraperlib.video`| FFmpeg |
51
+
|`download`|`zimscraperlib.download`| none; wget is only needed if your scraper calls it itself |
52
+
|`filesystem`|`zimscraperlib.filesystem` and MIME-type detection | libmagic |
53
+
|`html`|`zimscraperlib.html`| none |
54
+
|`rewriting`|`zimscraperlib.rewriting`| none |
55
+
|`i18n`|`zimscraperlib.i18n`| none |
56
+
|`all`| every runtime extra | every system dependency above |
57
+
58
+
Pillow uses pre-built wheels by default; no system image libraries are needed unless you build it from source (see [Pillow's build documentation](https://pillow.readthedocs.io/en/latest/installation/building-from-source.html)).
59
+
60
+
> **Note:** To run the full test suite, install `all` and all system dependencies listed above.
0 commit comments