1{
2 lib,
3 aiohttp,
4 aioresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 hatch-regex-commit,
8 hatchling,
9 pytest-asyncio,
10 pytestCheckHook,
11 python-dotenv,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "pyloadapi";
17 version = "1.4.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.12";
21
22 src = fetchFromGitHub {
23 owner = "tr4nt0r";
24 repo = "pyloadapi";
25 tag = "v${version}";
26 hash = "sha256-DkYbQB91KYskfm2yDVmR0/MJiixC2C5miHpTq7RpVBU=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail "--cov=src/pyloadapi/ --cov-report=term-missing" ""
32 '';
33
34 build-system = [
35 hatch-regex-commit
36 hatchling
37 ];
38
39 dependencies = [ aiohttp ];
40
41 nativeCheckInputs = [
42 aioresponses
43 pytest-asyncio
44 pytestCheckHook
45 python-dotenv
46 ];
47
48 pythonImportsCheck = [ "pyloadapi" ];
49
50 disabledTestPaths = [
51 # Tests require network access
52 "tests/test_cli.py"
53 ];
54
55 meta = with lib; {
56 description = "Simple wrapper for pyLoad's API";
57 homepage = "https://github.com/tr4nt0r/pyloadapi";
58 changelog = "https://github.com/tr4nt0r/pyloadapi/blob/${src.tag}/CHANGELOG.md";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}