From 7c36b7ac349d7d1710a7e32c112db8948b689cf5 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Sat, 31 May 2025 16:54:01 +0800 Subject: [PATCH] Update zstandard dependency and add Python 3.14 fix Updated the zstandard dependency to version 0.23.0 in README.md and pyproject.toml. Added a compatibility fix in src/tzst/__init__.py for Python 3.14 due to the removal of ByteString from typing. --- README.md | 2 +- pyproject.toml | 2 +- src/tzst/__init__.py | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a371de..6eb34df 100644 --- a/README.md +++ b/README.md @@ -570,7 +570,7 @@ extract_archive(large_archive, "restore/", streaming=True) ## Requirements - Python 3.12 or higher (including Python 3.14 pre-release) -- zstandard >= 0.19.0 +- zstandard >= 0.23.0 ## Development diff --git a/pyproject.toml b/pyproject.toml index d6ecc9c..a2825be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ "Topic :: System :: Archiving :: Compression", "Topic :: Software Development :: Libraries :: Python Modules", ] -dependencies = ["zstandard>=0.19.0,<1.0.0"] +dependencies = ["zstandard>=0.23.0,<1.0.0"] [project.optional-dependencies] dev = ["pytest>=7.0.0", "pytest-cov>=4.0.0", "ruff>=0.1.0", "black>=23.0.0"] diff --git a/src/tzst/__init__.py b/src/tzst/__init__.py index 036fab4..597166e 100644 --- a/src/tzst/__init__.py +++ b/src/tzst/__init__.py @@ -1,5 +1,20 @@ """tzst - A Python library for creating and manipulating .tzst/.tar.zst archives.""" +import sys + +# Compatibility fix for Python 3.14 - ByteString was removed from typing +# This is required for the zstandard library to work with Python 3.14+ +if sys.version_info >= (3, 14): + # ByteString was removed in Python 3.14, provide compatibility for zstandard + import typing + + try: + from collections.abc import ByteString + + typing.ByteString = ByteString + except ImportError: + pass + __version__ = "0.4.0" from .core import (