nixpkgs/pkgs/development/python-modules/binaryornot/default.nix
Ihar Hrachyshka 567e8dfd8e
treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

34 lines
768 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 = {
homepage = "https://github.com/audreyr/binaryornot";
description = "Ultra-lightweight pure Python package to check if a file is binary or text";
license = lib.licenses.bsd3;
};
}