Skip to content

hatch not using zstandard for python-3.14.0b3, for free-threading compatibility #2007

@stonebig

Description

@stonebig

would it be possible to not use zstandard on python-3.14, but instead the standard library ? to better enjoy the non-experimental nature of free-threading.

Copilote seems to allucinate that it might not be a problem:

elif self.source.endswith(('.tar.zst', '.tar.zstd')):
    import tarfile
    if sys.version_info[:2] >= (3, 14):
        from compression import zstd
        import io
        with open(archive, "rb") as ifh:
            dctx = zstd.ZstdDecompressor()
            decompressed = dctx.readall(ifh)
            with tarfile.open(fileobj=io.BytesIO(decompressed), mode="r:") as tf:
                if sys.version_info[:2] >= (3, 12):
                    tf.extractall(directory, filter="data")
                else:
                    tf.extractall(directory)  # noqa: S202
    else:
        import zstandard
        with open(archive, "rb") as ifh:
            dctx = zstandard.ZstdDecompressor()
            with dctx.stream_reader(ifh) as reader, tarfile.open(mode="r|", fileobj=reader) as tf:
                if sys.version_info[:2] >= (3, 12):
                    tf.extractall(directory, filter="data")
                else:
                    tf.extractall(directory)  # noqa: S202

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions