1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, poetry-core
6, aw-core
7, requests
8, persist-queue
9, click
10, tabulate
11, typing-extensions
12, pytestCheckHook
13}:
14
15buildPythonPackage rec {
16 pname = "aw-client";
17 version = "0.5.11";
18
19 format = "pyproject";
20
21 # pypi distribution doesn't include tests, so build from source instead
22 src = fetchFromGitHub {
23 owner = "ActivityWatch";
24 repo = "aw-client";
25 rev = "v${version}";
26 sha256 = "sha256-5WKGRoZGY+QnnB1Jzlju5OmCJreYMD8am2kW3Wcjhlw=";
27 };
28
29 disabled = pythonOlder "3.8";
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 aw-core
37 requests
38 persist-queue
39 click
40 tabulate
41 typing-extensions
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 ];
47
48 # Only run this test, the others are integration tests that require
49 # an instance of aw-server running in order to function.
50 pytestFlagsArray = [ "tests/test_requestqueue.py" ];
51
52 preCheck = ''
53 # Fake home folder for tests that write to $HOME
54 export HOME="$TMPDIR"
55 '';
56
57 pythonImportsCheck = [ "aw_client" ];
58
59 meta = with lib; {
60 description = "Client library for ActivityWatch";
61 homepage = "https://github.com/ActivityWatch/aw-client";
62 maintainers = with maintainers; [ huantian ];
63 license = licenses.mpl20;
64 };
65}