summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/blockchain/default.nix
blob: 77ee5fc554dbfb1c1d4e36d943f43dd45ef58ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
}:

buildPythonPackage (finalAttrs: {
  pname = "blockchain";
  version = "1.4.4";
  pyproject = true;

  src = fetchPypi {
    inherit (finalAttrs) pname version;
    hash = "sha256-26o+67b4G0JFAFc52oAsVxsJ+Y2X62ZSCv2V2cyv6+I=";
  };

  postPatch = ''
    substituteInPlace blockchain/blockexplorer.py \
      --replace-fail "from past.builtins import basestring" "basestring = str"
  '';

  build-system = [ setuptools ];

  pythonRemoveDeps = [
    "enum-compat"
    "future"
  ];

  # Tests require network access
  doCheck = false;

  pythonImportsCheck = [ "blockchain" ];

  meta = {
    description = "Blockchain API library (v1)";
    homepage = "https://github.com/blockchain/api-v1-client-python";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.jamiemagee ];
  };
})