1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 requests,
6 pytestCheckHook,
7 httpretty,
8 responses,
9}:
10
11buildPythonPackage rec {
12 pname = "fixerio";
13 version = "1.0.0-alpha";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "amatellanes";
18 repo = "fixerio";
19 rev = "v${version}";
20 sha256 = "009h1mys175xdyznn5bl980vly40544s4ph1zcgqwg2i2ic93gvb";
21 };
22
23 propagatedBuildInputs = [ requests ];
24
25 nativeCheckInputs = [
26 httpretty
27 pytestCheckHook
28 responses
29 ];
30
31 disabledTests = [
32 # tests require network access
33 "test_returns_historical_rates_for_symbols_passed_if_both"
34 "test_returns_historical_rates_for_symbols_passed_in_constructor"
35 "test_returns_historical_rates_for_symbols_passed_in_method"
36 "test_returns_latest_rates_for_symbols_passed_in_constructor"
37 "test_returns_latest_rates_for_symbols_passed_in_method"
38 "test_returns_latest_rates_for_symbols_passed_in_method_if_both"
39 ];
40
41 pythonImportsCheck = [ "fixerio" ];
42
43 meta = with lib; {
44 description = "Python client for Fixer.io";
45 longDescription = ''
46 Fixer.io is a free JSON API for current and historical foreign
47 exchange rates published by the European Central Bank.
48 '';
49 homepage = "https://github.com/amatellanes/fixerio";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ fab ];
52 };
53}