From 16169e5e36d0550c5bcc6c3f5606a82c7b77917a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Braghi=C8=99?= Date: Sun, 22 Oct 2023 13:08:26 +0100 Subject: [PATCH] Add optional dependencies for pillow/wand (#130) --- docs/installation.rst | 11 ++++++++++- pyproject.toml | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 399de99..3759b48 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -15,11 +15,20 @@ Installing underlying libraries ------------------------------- In order for most features of Willow to work, you need to install either Pillow -or Wand. +or Wand. You can follow the installation instructions for each of them: - `Pillow installation `_ - `Wand installation `_ +or you can install them together with Willow when using ``pip``: + +.. code-block:: shell + + pip install Willow[Pillow] + # or + pip install Willow[Wand] + + Note that Pillow doesn't support animated GIFs and Wand isn't as fast. Installing both will give best results. diff --git a/pyproject.toml b/pyproject.toml index 0c6af48..6891374 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,15 +31,15 @@ dependencies = [ ] [project.optional-dependencies] +pillow = ["Pillow>=9.1.0,<11.0.0"] +wand = ["Wand>=0.6,<1.0"] heif = [ "pillow-heif>=0.10.0,<1.0.0; python_version < '3.12'", "pillow-heif>=0.13.0,<1.0.0; python_version >= '3.12'", ] + testing = [ - "Pillow>=9.1.0,<11.0.0", - "Wand>=0.6,<1.0", - "mock>=3.0,<4.0", - "pillow-heif>=0.10.0,<1.0.0", + "willow[pillow,wand,heif]", "black==22.3.0", "ruff==0.0.275", "coverage[toml]>=7.2.7,<8.0",