1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 chardet,
6 hypothesis,
7}:
8
9buildPythonPackage rec {
10 pname = "binaryornot";
11 version = "0.4.4";
12 format = "setuptools";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061";
17 };
18
19 prePatch = ''
20 # TypeError: binary() got an unexpected keyword argument 'average_size'
21 substituteInPlace tests/test_check.py \
22 --replace "average_size=512" ""
23 '';
24
25 propagatedBuildInputs = [ chardet ];
26
27 nativeCheckInputs = [ hypothesis ];
28
29 meta = with lib; {
30 homepage = "https://github.com/audreyr/binaryornot";
31 description = "Ultra-lightweight pure Python package to check if a file is binary or text";
32 license = licenses.bsd3;
33 };
34}