nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonAtLeast,
7 flit-core,
8 nix-update-script,
9 httpx,
10 websockets,
11 pytestCheckHook,
12 pytest-asyncio,
13 typeguard,
14 gotify-server,
15}:
16
17buildPythonPackage rec {
18 pname = "gotify";
19 version = "0.6.0";
20 pyproject = true;
21 disabled = pythonAtLeast "3.14";
22
23 src = fetchFromGitHub {
24 owner = "d-k-bo";
25 repo = "python-gotify";
26 tag = "v${version}";
27 hash = "sha256-epm8m2W+ChOvWHZi2ruAD+HJGj+V7NfhmFLKeeqcpoI=";
28 };
29
30 build-system = [ flit-core ];
31
32 dependencies = [
33 httpx
34 websockets
35 ];
36
37 # tests raise an exception if the system is not Linux or Windows
38 doCheck = !stdenv.buildPlatform.isDarwin;
39
40 # tests require gotify-server to be located in ./tests/test-server/gotify-linux-{arch}
41 postPatch = ''
42 ln -s "${gotify-server}/bin/server" ./tests/test-server/gotify-linux-386
43 ln -s "${gotify-server}/bin/server" ./tests/test-server/gotify-linux-amd64
44 ln -s "${gotify-server}/bin/server" ./tests/test-server/gotify-linux-arm-7
45 ln -s "${gotify-server}/bin/server" ./tests/test-server/gotify-linux-arm64
46 '';
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 pytest-asyncio
51 typeguard
52 gotify-server
53 ];
54
55 pythonImportsCheck = [
56 "gotify"
57 ];
58
59 passthru.updateScript = nix-update-script { };
60
61 meta = {
62 changelog = "https://github.com/d-k-bo/python-gotify/releases/tag/v${version}";
63 description = "Python library to access your gotify server";
64 homepage = "https://github.com/d-k-bo/python-gotify";
65 license = lib.licenses.mit;
66 maintainers = [
67 lib.maintainers.joblade
68 ];
69 };
70}