Skip to content

Commit 28d3fe8

Browse files
committed
docs: fix Linux deps and improve contribution setup instructions
- Replace obsolete libjpeg8-dev with libjpeg-dev (virtual metapackage, works on both Debian and Ubuntu); clarify that -dev headers are only needed when building Pillow from source, not for normal development - Rewrite contribution setup to use `hatch shell` (consistent with other openZIM repos like ted, warc2zim, youtube); clarify that all commands must be run from the local clone root; add note on what pre-commit install does Closes #152, Closes #153
1 parent 8c16fa6 commit 28d3fe8

2 files changed

Lines changed: 36 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Add proper typing @overload to `zimscraperlib.image.optimize_xxx` methods (#273)
1818
- Backport wabac.JS change around rewriting: detect when JS is in 'strict' mode and avoid using 'arguments' (#286)
1919
- Fix installation from source, which missed wombatSetup.js (#287)
20+
- Fix obsolete `libjpeg8-dev` reference, replace with `libjpeg-dev` and clarify dev headers are only needed when building Pillow from source (#152)
21+
- Improve contribution setup instructions: use `hatch shell`, clarify commands must be run from local clone root (#153)
2022

2123
### Changed
2224

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,33 @@ See documentation at [Read the Docs](https://python-scraperlib.readthedocs.io/)
3333
3434
# Dependencies
3535

36-
- libmagic
37-
- wget
38-
- libzim (auto-installed, not available on Windows)
39-
- Pillow
40-
- FFmpeg
41-
- gifsicle (>=1.92)
42-
- libcairo (if you use the image manipulation, this is used for svg conversion)
36+
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+
38+
- **libmagic** — required for file type detection (used in most scrapers)
39+
- **wget** — required only for `zimscraperlib.download` functions
40+
- **FFmpeg** — required only for video processing functions
41+
- **gifsicle** (>=1.92) — required only for GIF optimization
42+
- **libcairo** — required only for SVG-to-PNG conversion
43+
- **libzim** — auto-installed via PyPI, not available on Windows
44+
- **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.
45+
> **Note:** To run the full test suite, all system packages listed above must be installed.
4346
4447
## macOS
4548

4649
```sh
47-
brew install libmagic wget libtiff libjpeg webp little-cms2 ffmpeg gifsicle
50+
brew install libmagic wget ffmpeg gifsicle
4851
```
4952

5053
## Linux
5154

5255
```sh
53-
sudo apt install libmagic1 wget ffmpeg \
54-
libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
55-
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
56-
libharfbuzz-dev libfribidi-dev libxcb1-dev gifsicle
56+
sudo apt install libmagic1 wget ffmpeg gifsicle
5757
```
5858

5959
## Alpine
6060

61-
```
62-
apk add ffmpeg gifsicle libmagic wget libjpeg
61+
```sh
62+
apk add ffmpeg gifsicle libmagic wget libjpeg-turbo
6363
```
6464

6565
# Contribution
@@ -68,11 +68,29 @@ This project adheres to openZIM's [Contribution Guidelines](https://github.com/o
6868

6969
This project has implemented openZIM's [Python bootstrap, conventions and policies](https://github.com/openzim/_python-bootstrap/docs/Policy.md) **v1.0.2**.
7070

71+
All instructions below must be run from the root of your local clone of this repository.
72+
73+
If you do not already have it on your system, install [hatch](https://hatch.pypa.io/latest/install/):
74+
7175
```shell
7276
pip install hatch
73-
pip install ".[dev]"
77+
```
78+
79+
Start a hatch shell — this will install all dependencies including dev in an isolated virtual environment:
80+
81+
```shell
82+
hatch shell
83+
```
84+
85+
Set up the pre-commit Git hook (runs linters automatically before each commit):
86+
87+
```shell
7488
pre-commit install
75-
# For tests
89+
```
90+
91+
Run tests with coverage:
92+
93+
```shell
7694
invoke coverage
7795
```
7896

0 commit comments

Comments
 (0)