summary refs log tree commit diff
path: root/pkgs/development/python-modules/ua-parser/default.nix
blob: ba0f75ce6f356aff2c0b5810996f8c9ec4e82fa9 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, buildPythonPackage
, fetchFromGitHub
, pyyaml
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "ua-parser";
  version = "0.18.0";

  format = "setuptools";

  src = fetchFromGitHub {
    owner = "ua-parser";
    repo = "uap-python";
    rev = version;
    fetchSubmodules = true;
    hash = "sha256-GiuGPnyYL0HQ/J2OpDTD1/panZCuzKtD3mKW5op5lXA=";
  };

  patches = [
    ./dont-fetch-submodule.patch
  ];

  nativeBuildInputs = [
    pyyaml
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  preCheck = ''
    # import from $out
    rm ua_parser/__init__.py
  '';

  pythonImportsCheck = [ "ua_parser" ];

  meta = with lib; {
    description = "A python implementation of the UA Parser";
    homepage = "https://github.com/ua-parser/uap-python";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ dotlambda ];
  };
}