Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / ua-parser / default.nix
blobba0f75ce6f356aff2c0b5810996f8c9ec4e82fa9
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pyyaml
5 , pytestCheckHook
6 }:
8 buildPythonPackage rec {
9   pname = "ua-parser";
10   version = "0.18.0";
12   format = "setuptools";
14   src = fetchFromGitHub {
15     owner = "ua-parser";
16     repo = "uap-python";
17     rev = version;
18     fetchSubmodules = true;
19     hash = "sha256-GiuGPnyYL0HQ/J2OpDTD1/panZCuzKtD3mKW5op5lXA=";
20   };
22   patches = [
23     ./dont-fetch-submodule.patch
24   ];
26   nativeBuildInputs = [
27     pyyaml
28   ];
30   nativeCheckInputs = [
31     pytestCheckHook
32   ];
34   preCheck = ''
35     # import from $out
36     rm ua_parser/__init__.py
37   '';
39   pythonImportsCheck = [ "ua_parser" ];
41   meta = with lib; {
42     description = "A python implementation of the UA Parser";
43     homepage = "https://github.com/ua-parser/uap-python";
44     license = licenses.asl20;
45     platforms = platforms.unix;
46     maintainers = with maintainers; [ dotlambda ];
47   };