Files
Matt Sturgeon 60a5dfd952 python3Packages.pystd: 0.17.0 → 0.18.0
Changelog:
- Support for Python 3.14
- Deprecate the `read_size` and `write_size` parameters of `ZstdFile` and `SeekableZstdFile`
- Deprecate `richmem_compress` and `RichMemZstdCompressor`
- Rework documentation to suggest using `compression.zstd` from Python stdlib, and provide a migration guide
- Include the `zstd` library license in package distributions

https://github.com/Rogdham/pyzstd/blob/0.18.0/CHANGELOG.md
2025-10-07 22:08:01 +01:00

78 lines
1.5 KiB
Nix

{
buildPythonPackage,
fetchFromGitHub,
lib,
pytestCheckHook,
pythonOlder,
setuptools,
typing-extensions,
zstd-c,
}:
buildPythonPackage rec {
pname = "pyzstd";
version = "0.18.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Rogdham";
repo = "pyzstd";
tag = version;
hash = "sha256-15+GqJ/AMYs1R9ywo+muNVVbPkkzTMj//Zn/PPI+MCI=";
};
postPatch = ''
# pyzst specifies setuptools<74 because 74+ drops `distutils.msvc9compiler`,
# required for Python 3.9 under Windows
substituteInPlace pyproject.toml \
--replace-fail '"setuptools>=64,<74"' '"setuptools"'
# pyzst needs a copy of upstream zstd's license
ln -s ${zstd-c.src}/LICENSE zstd
'';
nativeBuildInputs = [
setuptools
];
build-system = [
setuptools
];
dependencies = lib.optionals (pythonOlder "3.13") [
typing-extensions
];
pythonRelaxDeps = [
"typing-extensions"
];
buildInputs = [
zstd-c
];
pypaBuildFlags = [
"--config-setting=--global-option=--dynamic-link-zstd"
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"pyzstd"
];
meta = {
description = "Python bindings to Zstandard (zstd) compression library";
homepage = "https://pyzstd.readthedocs.io";
changelog = "https://github.com/Rogdham/pyzstd/blob/${version}/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
MattSturgeon
pitkling
PopeRigby
];
};
}