summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/homf/default.nix
blob: c5e4352c98516d12f84d5365b76f40be98d669f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  lib,
  buildPythonPackage,
  callPackage,
  fetchFromGitHub,
  # pytestCheckHook,
  versionCheckHook,

  hatchling,
  packaging,
}:

buildPythonPackage rec {
  pname = "homf";
  version = "1.1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "duckinator";
    repo = "homf";
    tag = "v${version}";
    hash = "sha256-fDH6uJ2d/Jsnuudv+Qlv1tr3slxOJWh7b4smGS32n9A=";
  };

  build-system = [ hatchling ];

  pythonRelaxDeps = [ "packaging" ];
  dependencies = [ packaging ];

  pythonImportsCheck = [
    "homf"
    "homf.api"
    "homf.api.github"
    "homf.api.pypi"
  ];

  # There are currently no checks which do not require network access, which breaks the check hook somehow?
  # nativeCheckInputs = [ pytestCheckHook ];
  # disabledTestMarks = [ "network" ];

  nativeBuildInputs = [ versionCheckHook ];

  # (Ab)using `callPackage` as a fix-point operator, so tests can use the `homf` drv
  passthru.tests = callPackage ./tests.nix { };

  meta = {
    description = "Asset download tool for GitHub Releases, PyPi, etc";
    mainProgram = "homf";
    homepage = "https://github.com/duckinator/homf";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ nicoo ];
  };
}