albumentations.check_version


Version checking functionality for AlbumentationsX. This module provides functionality to check for updates to the AlbumentationsX package by comparing the current version with the latest version available on PyPI. Features: - Check for updates from PyPI with caching (24-hour cache) - DNS-based connectivity check for better reliability - Environment variable controls (NO_ALBUMENTATIONS_UPDATE, ALBUMENTATIONS_OFFLINE) - Graceful failure handling - Support for pre-release versions Environment Variables: NO_ALBUMENTATIONS_UPDATE: Set to "1" or "true" to disable update checks ALBUMENTATIONS_OFFLINE: Set to "1" or "true" to force offline mode Usage: >>> from albumentations.check_version import check_for_updates >>> check_for_updates()

check_for_updatesfunction

Check for available updates to AlbumentationsX.

Parameters

NameTypeDefaultDescription
verboseboolTrueWhether to print update messages.

Returns

  • : Tuple of (update_available, latest_version)

fetch_pypi_versionfunction

Fetch the latest version from PyPI.

get_cache_dirfunction

Get platform-appropriate cache directory.

get_latest_versionfunction

Get the latest version with caching.

parse_versionfunction

Parse version string into comparable tuple.

Parameters

NameTypeDefaultDescription
versionstr--

Examples

"1.4.24" -> (1, 4, 24, 0, 0)
"1.4.0-beta.2" -> (1, 4, 0, -2, 2)

read_cachefunction

Read version from cache file if not expired.

write_cachefunction

Write version to cache file.

Parameters

NameTypeDefaultDescription
versionstr--