1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pyyaml,
6 pytestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "ua-parser";
11 version = "0.18.0";
12
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "ua-parser";
17 repo = "uap-python";
18 rev = version;
19 fetchSubmodules = true;
20 hash = "sha256-GiuGPnyYL0HQ/J2OpDTD1/panZCuzKtD3mKW5op5lXA=";
21 };
22
23 patches = [ ./dont-fetch-submodule.patch ];
24
25 nativeBuildInputs = [ pyyaml ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 preCheck = ''
30 # import from $out
31 rm ua_parser/__init__.py
32 '';
33
34 pythonImportsCheck = [ "ua_parser" ];
35
36 meta = with lib; {
37 description = "Python implementation of the UA Parser";
38 homepage = "https://github.com/ua-parser/uap-python";
39 license = licenses.asl20;
40 platforms = platforms.unix;
41 maintainers = with maintainers; [ dotlambda ];
42 };
43}