Skip to content

gh-117404: Add structured version info for compression modules#150567

Open
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:compression-library-versions-2
Open

gh-117404: Add structured version info for compression modules#150567
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:compression-library-versions-2

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented May 29, 2026

Add a number of constants in modules zlib, bz2, lzma, and compression.zstd, which provide information about the version of libraries that were used for building the module and that are actually loaded:

  • zlib.zlib_version -- an alias of zlib.ZLIB_RUNTIME_VERSION
  • zlib.ZLIB_VERSION_INFO
  • zlib.zlib_version_info
  • zlib.zlibng_version
  • zlib.ZLIBNG_VERSION_INFO
  • zlib.zlibng_version_info
  • bz2.bzlib_version
  • bz2.bzlib_version_info
  • lzma.LZMA_VERSION
  • lzma.lzma_version
  • lzma.LZMA_VERSION_INFO
  • lzma.lzma_version_info
  • compression.zstd.ZSTD_VERSION
  • compression.zstd.ZSTD_VERSION_INFO

Make compression.zstd.zstd_version_info a named tuple.

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 29, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32901808 | 📁 Comparing 0c71967 against main (1d4e965)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

Add a number of constants in modules zlib, bz2, lzma, and
compression.zstd, which provide information about the version
of libraries that were used for building the module and that
are actually loaded:

* zlib.zlib_version -- an alias of zlib.ZLIB_RUNTIME_VERSION
* zlib.ZLIB_VERSION_INFO
* zlib.zlib_version_info
* zlib.zlibng_version
* zlib.ZLIBNG_VERSION_INFO
* zlib.zlibng_version_info
* bz2.bzlib_version
* bz2.bzlib_version_info
* lzma.LZMA_VERSION
* lzma.lzma_version
* lzma.LZMA_VERSION_INFO
* lzma.lzma_version_info
* compression.zstd.ZSTD_VERSION
* compression.zstd.ZSTD_VERSION_INFO

Make compression.zstd.zstd_version_info a named tuple.
@serhiy-storchaka serhiy-storchaka force-pushed the compression-library-versions-2 branch from f57fc45 to 76354de Compare May 29, 2026 07:39
The version string of the zstd library actually loaded by the interpreter.


.. data:: ZSTD_VERSION_INFO
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.

I think these should be ordered:

ZSTD_VERSION
ZSTD_VERSION_INFO
zstd_version
zstd_version_info

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But would not it put zstd_version too far from ZSTD_VERSION and zstd_version_info from ZSTD_VERSION_INFO? They are documented in pairs, the descriptions for zstd_version and zstd_version_info do not repeat all text from ZSTD_VERSION and ZSTD_VERSION_INFO, but rely on their proximity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants