1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pyyaml
5, pytestCheckHook
6}:
7
8buildPythonPackage rec {
9 pname = "ua-parser";
10 version = "0.16.1";
11
12 format = "setuptools";
13
14 src = fetchFromGitHub {
15 owner = "ua-parser";
16 repo = "uap-python";
17 rev = version;
18 fetchSubmodules = true;
19 hash = "sha256-vyzeRi/wYEyezSU+EigJATgrNvABGCWVWlSFhKGipLE=";
20 };
21
22 patches = [
23 ./dont-fetch-submodule.patch
24 ];
25
26 nativeBuildInputs = [
27 pyyaml
28 ];
29
30 checkInputs = [
31 pytestCheckHook
32 ];
33
34 preCheck = ''
35 # import from $out
36 rm ua_parser/__init__.py
37 '';
38
39 pythonImportsCheck = [ "ua_parser" ];
40
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 };
48}