depot/third_party/nixpkgs/pkgs/development/python-modules/binaryornot/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

28 lines
763 B
Nix

{ lib, buildPythonPackage, fetchPypi, chardet, hypothesis }:
buildPythonPackage rec {
pname = "binaryornot";
version = "0.4.4";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061";
};
prePatch = ''
# TypeError: binary() got an unexpected keyword argument 'average_size'
substituteInPlace tests/test_check.py \
--replace "average_size=512" ""
'';
propagatedBuildInputs = [ chardet ];
nativeCheckInputs = [ hypothesis ];
meta = with lib; {
homepage = "https://github.com/audreyr/binaryornot";
description = "Ultra-lightweight pure Python package to check if a file is binary or text";
license = licenses.bsd3;
};
}