about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/binaryornot/default.nix
blob: 103bd79294e651f094c60b4a6d2755de1cfe60a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ lib, buildPythonPackage, fetchPypi, chardet, hypothesis }:

buildPythonPackage rec {
  pname = "binaryornot";
  version = "0.4.4";

  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 ];

  checkInputs = [ 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;
  };
}