Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
pip install flake8
flake8 .

- name: Type check with mypy
run: |
pip install mypy
mypy pyvips/__init__.pyi --no-error-summary
mypy examples/affine.py examples/convolve.py --no-error-summary

- name: Install tox and any other packages
run: pip install tox

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- fix get_gainmap arguments [jcupitt]
- fix __array__ copy argument test [jcupitt]
- add a test [jcupitt]
- add type stub generation script with support for all libvips operations [AI Assistant]

## Version 3.1.0 (released 8 December 2025)

Expand Down
34 changes: 34 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@ Stylecheck:

$ flake8

Stylecheck:

.. code-block:: shell

$ flake8

Type checking:

pyvips includes type hints via PEP 561 type stub files (``pyvips/__init__.pyi``).
To enable type checking in your project, install a type checker like mypy:

.. code-block:: shell

$ pip install mypy pyvips

Then run mypy on your code:

.. code-block:: shell

$ mypy your_script.py

Note: ``pyvips`` methods accept arbitrary keyword arguments for libvips options,
which may not be fully covered by type hints.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? We seem to have them all covered, I think.


Generate HTML docs in ``doc/build/html``:

.. code-block:: shell
Expand All @@ -246,6 +270,16 @@ then

Then check and move `enums.py` into `pyvips/`.

Regenerate type stubs:

After adding new libvips operations or updating libvips itself, regenerate type stubs:

.. code-block:: shell

$ python examples/generate_type_stubs.py

This updates ``pyvips/__init__.pyi`` with the latest operations.

Regenerate autodocs:

Make sure you have installed a libvips with all optional packages enabled,
Expand Down
Loading