Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
serhiy-storchaka wants to merge 6 commits into
python:mainfrom
serhiy-storchaka:compression-library-versions
Closed

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

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Mar 31, 2024

Copy link
Copy Markdown
Member
  • Add named tuples zlib_version and zlib_runtime_version in the zlib module.
  • Add string BZLIB_VERSION and named tuple bzlib_version in the bz2 module.
  • Add strings LZMA_VERSION and LZMA_RUNTIME_VERSION and named tuples lzma_version and lzma_runtime_version in the lzma module.

📚 Documentation preview 📚: https://cpython-previews--117405.org.readthedocs.build/

* Add named tuples zlib_version and zlib_runtime_version in the zlib
  module.
* Add string BZLIB_VERSION and named tuple bzlib_version in the bz2
  module.
* Add strings LZMA_VERSION and LZMA_RUNTIME_VERSION and named tuples
  lzma_version and lzma_runtime_version in the lzma module.
@gpshead

gpshead commented Mar 31, 2024

Copy link
Copy Markdown
Member

How about we shorten the names, there is no need to repeat the module name in the name of the constant.

@ned-deily

Copy link
Copy Markdown
Member

How about we shorten the names, there is no need to repeat the module name in the name of the constant.

Perhaps we should use the same prefixes we use for the corresponding configure options, i.e. ZLIB, BZIP2, and LIBLZMA.

  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
  BZIP2_CFLAGS
              C compiler flags for BZIP2, overriding pkg-config
  BZIP2_LIBS  linker flags for BZIP2, overriding pkg-config
  LIBLZMA_CFLAGS
              C compiler flags for LIBLZMA, overriding pkg-config
  LIBLZMA_LIBS
              linker flags for LIBLZMA, overriding pkg-config

@gpshead

gpshead commented Apr 1, 2024

Copy link
Copy Markdown
Member

Perhaps we should use the same prefixes we use for the corresponding configure options, i.e. ZLIB, BZIP2, and LIBLZMA.

That'd take us in the wrong direction. These are for use by people writing Python code, not for use by people who build CPython. lzma.version -> (2,4,6) is clear and concise. lzma.LZMA_VERSION is needlessly repetitive.

this is a bikeshed, we could also argue that constants must always be in CAPS and ask for lzma.VERSION or for the lower case one to be a callable lzma.version(). I don't think it matters that much. I lean towards make the most likely to be used and thing people want one be the easiest to type. But I'd accept any, these aren't worth arguing over. The few people who need them will use them under whatever names we provide them as.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Let continue the main design discussion on the issue, and only use PR for discussing minor implementation details.

Comment thread Doc/library/bz2.rst Outdated
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 16, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32779352 | 📁 Comparing ed78a4c against main (87a879f)

  🔍 Preview build  

4 files changed
± library/archiving.html
± library/bz2.html
± library/lzma.html
± library/zlib.html

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 21, 2026
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants