about summary refs log tree commit diff
path: root/pkgs/development/python-modules/homf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/homf/default.nix')
-rw-r--r--pkgs/development/python-modules/homf/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/homf/default.nix b/pkgs/development/python-modules/homf/default.nix
new file mode 100644
index 0000000000000..cd58234c23498
--- /dev/null
+++ b/pkgs/development/python-modules/homf/default.nix
@@ -0,0 +1,55 @@
+{
+  lib,
+  buildPythonPackage,
+  callPackage,
+  fetchFromGitHub,
+  # pytestCheckHook,
+  pythonOlder,
+  versionCheckHook,
+
+  hatchling,
+  packaging,
+}:
+
+buildPythonPackage rec {
+  pname = "homf";
+  version = "1.1.1";
+  pyproject = true;
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "duckinator";
+    repo = "homf";
+    rev = "refs/tags/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 ];
+  # pytestFlagsArray = [ "-m 'not network'" ];
+
+  nativeBuildInputs = [ versionCheckHook ];
+
+  # (Ab)using `callPackage` as a fix-point operator, so tests can use the `homf` drv
+  passthru.tests = callPackage ./tests.nix { };
+
+  meta = with lib; {
+    description = "Asset download tool for GitHub Releases, PyPi, etc.";
+    mainProgram = "homf";
+    homepage = "https://github.com/duckinator/homf";
+    license = licenses.mit;
+    maintainers = with maintainers; [ nicoo ];
+  };
+}