Skip to content

Commit 7a71230

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 7a71230

2 files changed

Lines changed: 35 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: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,32 @@ 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 via PyPI. 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.
4345

4446
## macOS
4547

4648
```sh
47-
brew install libmagic wget libtiff libjpeg webp little-cms2 ffmpeg gifsicle
49+
brew install libmagic wget ffmpeg gifsicle
4850
```
4951

5052
## Linux
5153

5254
```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
55+
sudo apt install libmagic1 wget ffmpeg gifsicle
5756
```
5857

5958
## Alpine
6059

61-
```
62-
apk add ffmpeg gifsicle libmagic wget libjpeg
60+
```sh
61+
apk add ffmpeg gifsicle libmagic wget
6362
```
6463

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

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

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

0 commit comments

Comments
 (0)