From eae59e69fc8e1d14a8a76c5af47af46357e18634 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 13 Mar 2025 16:15:24 +0100 Subject: [PATCH 1/5] Ensure `pyvips.shutdown()` is public --- pyvips/voperation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyvips/voperation.py b/pyvips/voperation.py index c3d7226..6a3021b 100644 --- a/pyvips/voperation.py +++ b/pyvips/voperation.py @@ -598,7 +598,7 @@ def operation_block_set(name, state): __all__ = [ - 'Introspect', 'Operation', + 'Introspect', 'Operation', 'shutdown', 'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files', 'cache_set_trace', 'cache_get_max', 'cache_get_max_mem', 'cache_get_max_files', From 9f4191e2b096b04e9da54966ae632020aeff0834 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 13 Mar 2025 16:16:45 +0100 Subject: [PATCH 2/5] Move `pyvips.shutdown()` to `base.py` --- pyvips/base.py | 6 ++++++ pyvips/voperation.py | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyvips/base.py b/pyvips/base.py index be76153..052b612 100644 --- a/pyvips/base.py +++ b/pyvips/base.py @@ -15,6 +15,11 @@ def leak_set(leak): return vips_lib.vips_leak_set(leak) +def shutdown(): + """Shut libvips down.""" + vips_lib.vips_shutdown() + + def version(flag): """Get the major, minor or micro version number of the libvips library. @@ -152,6 +157,7 @@ def flags_dict(gtype): __all__ = [ 'leak_set', + 'shutdown', 'version', 'at_least_libvips', 'type_find', diff --git a/pyvips/voperation.py b/pyvips/voperation.py index 6a3021b..849fcb8 100644 --- a/pyvips/voperation.py +++ b/pyvips/voperation.py @@ -540,11 +540,6 @@ def add_name(gtype, a, b): print(' ' + docstr) -def shutdown(): - """Shut libvips down.""" - vips_lib.vips_shutdown() - - def cache_set_max(mx): """Set the maximum number of operations libvips will cache.""" vips_lib.vips_cache_set_max(mx) @@ -598,7 +593,7 @@ def operation_block_set(name, state): __all__ = [ - 'Introspect', 'Operation', 'shutdown', + 'Introspect', 'Operation', 'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files', 'cache_set_trace', 'cache_get_max', 'cache_get_max_mem', 'cache_get_max_files', From c4f9174ea861b065c3e72bdcbd2785f135e3945d Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 13 Mar 2025 16:18:20 +0100 Subject: [PATCH 3/5] Reformat --- pyvips/error.py | 5 ++++- pyvips/vdecls.py | 4 +--- pyvips/voperation.py | 14 ++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pyvips/error.py b/pyvips/error.py index 8e78b78..3419d10 100644 --- a/pyvips/error.py +++ b/pyvips/error.py @@ -72,5 +72,8 @@ def __str__(self): __all__ = [ - '_to_bytes', '_to_string', '_to_string_copy', 'Error', + '_to_bytes', + '_to_string', + '_to_string_copy', + 'Error' ] diff --git a/pyvips/vdecls.py b/pyvips/vdecls.py index ee034b5..da3efec 100644 --- a/pyvips/vdecls.py +++ b/pyvips/vdecls.py @@ -480,6 +480,4 @@ def cdefs(features): return code -__all__ = [ - 'cdefs' -] +__all__ = ['cdefs'] diff --git a/pyvips/voperation.py b/pyvips/voperation.py index 849fcb8..4e2db57 100644 --- a/pyvips/voperation.py +++ b/pyvips/voperation.py @@ -593,10 +593,16 @@ def operation_block_set(name, state): __all__ = [ - 'Introspect', 'Operation', - 'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files', + 'Introspect', + 'Operation', + 'cache_set_max', + 'cache_set_max_mem', + 'cache_set_max_files', 'cache_set_trace', - 'cache_get_max', 'cache_get_max_mem', 'cache_get_max_files', + 'cache_get_max', + 'cache_get_max_mem', + 'cache_get_max_files', 'cache_get_size', - 'block_untrusted_set', 'operation_block_set', + 'block_untrusted_set', + 'operation_block_set' ] From b58d87238097850264f28a831f009a32e6939200 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 13 Mar 2025 16:19:00 +0100 Subject: [PATCH 4/5] De-duplicate `__all__` in `__init__.py` with other modules --- pyvips/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyvips/__init__.py b/pyvips/__init__.py index b917f21..90032f1 100644 --- a/pyvips/__init__.py +++ b/pyvips/__init__.py @@ -196,10 +196,4 @@ def _remove_log_handler(): from .vimage import * from .vregion import * -__all__ = [ - 'Error', 'Image', 'Region', 'Introspect', 'Operation', 'GValue', 'Interpolate', 'GObject', - 'VipsObject', 'type_find', 'type_name', 'version', '__version__', - 'at_least_libvips', 'API_mode', - 'get_suffixes', - 'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files', -] +__all__ = ['API_mode'] From 50b9aa85a4a44aa287ecea7b862077eafd96d528 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 13 Mar 2025 16:19:11 +0100 Subject: [PATCH 5/5] Fix typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 92a1e2b..f54ab83 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ with: This installs a self-contained package with the most commonly needed libraries. It should just work on most common platforms, including Linux, -Window and macOS, with x64 and ARM CPUs. +Windows and macOS, with x64 and ARM CPUs. If your platform is unsupported or the pre-built binary is unsuitable, you can install libvips separately instead.