diff --git a/pkgs/development/python-modules/filetype/default.nix b/pkgs/development/python-modules/filetype/default.nix new file mode 100644 index 000000000000..e47c007b9678 --- /dev/null +++ b/pkgs/development/python-modules/filetype/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, python +}: + +buildPythonPackage rec { + pname = "filetype"; + version = "1.0.2"; + + # No tests in PyPI tarball + # See https://github.com/h2non/filetype.py/pull/33 + src = fetchFromGitHub { + owner = "h2non"; + repo = "filetype.py"; + rev = "v${version}"; + sha256 = "000gl3q2cadfnmqnbxg31ppc3ak8blzb4nfn75faxbp7b6r5qgr2"; + }; + + checkPhase = '' + ${python.interpreter} -m unittest discover + ''; + + meta = with lib; { + description = "Infer file type and MIME type of any file/buffer"; + homepage = https://github.com/h2non/filetype.py; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6d672834dd3b..7f29e7eace3b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1745,6 +1745,8 @@ in { fb-re2 = callPackage ../development/python-modules/fb-re2 { }; + filetype = callPackage ../development/python-modules/filetype { }; + flexmock = callPackage ../development/python-modules/flexmock { }; flit = callPackage ../development/python-modules/flit { };