about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyloadapi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyloadapi/default.nix')
-rw-r--r--pkgs/development/python-modules/pyloadapi/default.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyloadapi/default.nix b/pkgs/development/python-modules/pyloadapi/default.nix
new file mode 100644
index 0000000000000..aec92117415c9
--- /dev/null
+++ b/pkgs/development/python-modules/pyloadapi/default.nix
@@ -0,0 +1,58 @@
+{
+  lib,
+  aiohttp,
+  aioresponses,
+  buildPythonPackage,
+  fetchFromGitHub,
+  hatch-regex-commit,
+  hatchling,
+  pytest-asyncio,
+  pytestCheckHook,
+  python-dotenv,
+  pythonOlder,
+}:
+
+buildPythonPackage rec {
+  pname = "pyloadapi";
+  version = "1.2.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.12";
+
+  src = fetchFromGitHub {
+    owner = "tr4nt0r";
+    repo = "pyloadapi";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-uOgqc1RqmEk0Lqz/ixlChKTZva7+0v4V8KutLSgPKEE=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace-fail "--cov=src/pyloadapi/ --cov-report=term-missing" ""
+  '';
+
+  build-system = [
+    hatch-regex-commit
+    hatchling
+  ];
+
+  dependencies = [ aiohttp ];
+
+  nativeCheckInputs = [
+    aioresponses
+    pytest-asyncio
+    pytestCheckHook
+    python-dotenv
+  ];
+
+  pythonImportsCheck = [ "pyloadapi" ];
+
+  meta = with lib; {
+    description = "Simple wrapper for pyLoad's API";
+    homepage = "https://github.com/tr4nt0r/pyloadapi";
+    changelog = "https://github.com/tr4nt0r/pyloadapi/blob/${version}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
+