depot/third_party/nixpkgs/pkgs/development/python-modules/lz4/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

67 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pkgconfig,
psutil,
pytestCheckHook,
python,
pythonOlder,
setuptools,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "lz4";
version = "4.3.3";
pyproject = true;
disabled = pythonOlder "3.5";
# get full repository in order to run tests
src = fetchFromGitHub {
owner = "python-lz4";
repo = "python-lz4";
rev = "refs/tags/v${version}";
hash = "sha256-ZvGUkb9DoheYY2/sejUhxgh2lS5eoBrFCXR4E0IcFcs=";
};
postPatch = ''
sed -i '/pytest-cov/d' setup.py
'';
build-system = [
pkgconfig
setuptools-scm
setuptools
];
pythonImportsCheck = [
"lz4"
"lz4.block"
"lz4.frame"
"lz4.stream"
];
nativeCheckInputs = [
psutil
pytestCheckHook
];
# for lz4.steam
env.PYLZ4_EXPERIMENTAL = true;
# prevent local lz4 directory from getting imported as it lacks native extensions
preCheck = ''
rm -r lz4
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
'';
meta = with lib; {
description = "LZ4 Bindings for Python";
homepage = "https://github.com/python-lz4/python-lz4";
changelog = "https://github.com/python-lz4/python-lz4/releases/tag/v${version}";
license = licenses.bsd3;
maintainers = [ ];
};
}