1{
2 lib,
3 buildPythonPackage,
4 callPackage,
5 fetchFromGitHub,
6 # pytestCheckHook,
7 pythonOlder,
8 versionCheckHook,
9
10 hatchling,
11 packaging,
12}:
13
14buildPythonPackage rec {
15 pname = "homf";
16 version = "1.1.1";
17 pyproject = true;
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "duckinator";
22 repo = "homf";
23 tag = "v${version}";
24 hash = "sha256-fDH6uJ2d/Jsnuudv+Qlv1tr3slxOJWh7b4smGS32n9A=";
25 };
26
27 build-system = [ hatchling ];
28
29 pythonRelaxDeps = [ "packaging" ];
30 dependencies = [ packaging ];
31
32 pythonImportsCheck = [
33 "homf"
34 "homf.api"
35 "homf.api.github"
36 "homf.api.pypi"
37 ];
38
39 # There are currently no checks which do not require network access, which breaks the check hook somehow?
40 # nativeCheckInputs = [ pytestCheckHook ];
41 # disabledTestMarks = [ "network" ];
42
43 nativeBuildInputs = [ versionCheckHook ];
44
45 # (Ab)using `callPackage` as a fix-point operator, so tests can use the `homf` drv
46 passthru.tests = callPackage ./tests.nix { };
47
48 meta = with lib; {
49 description = "Asset download tool for GitHub Releases, PyPi, etc";
50 mainProgram = "homf";
51 homepage = "https://github.com/duckinator/homf";
52 license = licenses.mit;
53 maintainers = with maintainers; [ nicoo ];
54 };
55}