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