1{
2 lib,
3 aiohttp,
4 aioresponses,
5 pydantic,
6 buildPythonPackage,
7 fetchFromGitHub,
8 poetry-core,
9 pytest-aiohttp,
10 pytestCheckHook,
11 pythonOlder,
12 pythonRelaxDepsHook,
13}:
14
15buildPythonPackage rec {
16 pname = "aioopenexchangerates";
17 version = "0.4.11";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "MartinHjelmare";
24 repo = "aioopenexchangerates";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-8AScYCDgv8Dkjt/0WJ4P2q2H9dykuq3w00qDDP8PiSs=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail " --cov=aioopenexchangerates --cov-report=term-missing:skip-covered" ""
32 '';
33
34 pythonRelaxDeps = [ "pydantic" ];
35
36 build-system = [ poetry-core ];
37
38 nativeBuildInputs = [ pythonRelaxDepsHook ];
39
40 dependencies = [
41 aiohttp
42 pydantic
43 ];
44
45 nativeCheckInputs = [
46 aioresponses
47 pytest-aiohttp
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "aioopenexchangerates" ];
52
53 meta = with lib; {
54 description = "Library for the Openexchangerates API";
55 homepage = "https://github.com/MartinHjelmare/aioopenexchangerates";
56 changelog = "https://github.com/MartinHjelmare/aioopenexchangerates/blob/v${version}/CHANGELOG.md";
57 license = with licenses; [ asl20 ];
58 maintainers = with maintainers; [ fab ];
59 };
60}