Skip to content

Add optional LZ4 frame support (refresh #168) - #181

Merged
marcelm merged 2 commits into
pycompression:mainfrom
Dev-iL:lz4-pr168-refresh
Oct 22, 2026
Merged

marcelm merged 2 commits into
pycompression:mainfrom
Dev-iL:lz4-pr168-refresh

Conversation

@Dev-iL

@Dev-iL Dev-iL commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refreshes the LZ4 work from #168 on current main (0818f20).

  • Adds standard LZ4 frame reading and writing, including .lz4 extension and frame-header detection.
  • Keeps Python LZ4 optional via pip install xopen[lz4], with the lz4 program as a fallback when subprocesses are allowed. PyPy uses the CLI.
  • Avoids passing -T to older LZ4 binaries, adds a frame fixture and CLI/binding CI coverage, and makes Ruff's existing basic rule set explicit for newer Ruff releases.

The original work was done by @gnzsnz in #168, credited via a Co-authored-by note.

AI Disclosure

Codex (GPT-6-Sol) was used to author this PR.

@Dev-iL

Dev-iL commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@marcelm @rhpvorderman Can you take a look please?

@rhpvorderman rhpvorderman left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are some obvious issues with the compression level ranges. I found this because I wondered if lz4 supported a "0" mode (uncompressed data), like zlib does. It turns out it is not even in the range.

EDIT: Removal of false assumptions.

Comment thread src/xopen/__init__.py Resolved
Comment thread src/xopen/__init__.py Resolved
@Dev-iL
Dev-iL requested a review from rhpvorderman September 28, 2026 11:00
@rhpvorderman

Copy link
Copy Markdown
Collaborator

I apologize for my previous comment about the AI code being unchecked. That was based on false assumptions and I should have been more wise than to make these.

@rhpvorderman rhpvorderman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. @marcelm any thoughts?

@Dev-iL Dev-iL closed this Sep 29, 2026
@Dev-iL Dev-iL reopened this Sep 29, 2026
@Dev-iL

Dev-iL commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@marcelm Any comments? If not, could you please merge and make a new release?

@marcelm marcelm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, but please remove me as co-author from the first commit (the work was essentially done by @gnzsnz; I only contributed two small commits).

Comment thread src/xopen/__init__.py Resolved
Dev-iL and others added 2 commits October 22, 2026 23:07
Refresh the LZ4 work from pycompression#168 against current main.

Co-authored-by: gonzo <gonzalosaenz@gmail.com>
@Dev-iL
Dev-iL force-pushed the lz4-pr168-refresh branch from 07eea4c to 79ad6da Compare October 22, 2026 20:08
@marcelm

marcelm commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@marcelm
marcelm merged commit 9440d96 into pycompression:main Oct 22, 2026
14 of 15 checks passed
@Dev-iL
Dev-iL deleted the lz4-pr168-refresh branch October 22, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants