1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 aiohttp,
12 frozendict,
13 inject,
14 joblib,
15 loguru,
16 nix,
17 nix-prefetch-git,
18 nurl,
19 platformdirs,
20 pydantic,
21 typer,
22
23 # tests
24 writableTmpDirAsHomeHook,
25 pytestCheckHook,
26 aioresponses,
27 pytest-asyncio,
28 pytest-cov-stub,
29 pytest-mock,
30}:
31buildPythonPackage rec {
32 pname = "nixpkgs-updaters-library";
33 version = "3.0.0";
34 pyproject = true;
35
36 disabled = pythonOlder "3.13";
37
38 src = fetchFromGitHub {
39 owner = "PerchunPak";
40 repo = "nixpkgs-updaters-library";
41 tag = "v${version}";
42 hash = "sha256-0N88valEw+QElMjy84TBKGuqqh9anKhHdW0jQfQ4qd4=";
43 };
44
45 postPatch = ''
46 substituteInPlace nupd/executables.py \
47 --replace-fail '"nurl"' '"${lib.getExe nurl}"' \
48 --replace-fail '"nix-prefetch-url"' '"${lib.getExe' nix "nix-prefetch-git"}"' \
49 --replace-fail '"nix-prefetch-git"' '"${lib.getExe' nix-prefetch-git "nix-prefetch-git"}"'
50 '';
51
52 build-system = [ hatchling ];
53
54 dependencies = [
55 aiohttp
56 frozendict
57 inject
58 joblib
59 loguru
60 platformdirs
61 pydantic
62 typer
63 ];
64
65 nativeCheckInputs = [
66 writableTmpDirAsHomeHook
67 aioresponses
68 pytest-asyncio
69 pytest-cov-stub
70 pytest-mock
71 pytestCheckHook
72 ];
73
74 meta = {
75 description = "Boilerplate-less updater library for Nixpkgs ecosystems";
76 homepage = "https://github.com/PerchunPak/nixpkgs-updaters-library";
77 changelog = "https://github.com/PerchunPak/nixpkgs-updaters-library/blob/${src.tag}/CHANGELOG.md";
78 license = lib.licenses.mit;
79 maintainers = with lib.maintainers; [ perchun ];
80 };
81}