about summary refs log tree commit diff
path: root/pkgs/development/python-modules/internetarchive/default.nix
blob: ff077bd1b01e5431232234889087e9e0fec4d5ee (plain) (blame)
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
42
43
44
45
46
47
48
{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, six, clint, pyyaml, docopt
, requests, jsonpatch, args, schema, responses, backports_csv }:

buildPythonPackage rec {

  pname = "internetarchive";
  version = "1.7.2";
  name = "${pname}-${version}";

  # Can't use pypi, data files for tests missing
  src = fetchFromGitHub {
    owner = "jjjake";
    repo = "internetarchive";
    rev = "v${version}";
    sha256 = "1cijagy22qi8ydrvizqmi1whnc3qr94yk0910lwgpxjywcygggir";
  };
    # It is hardcoded to specific versions, I don't know why.
    preConfigure = ''
        sed "s/schema>=.*/schema>=0.4.0',/" -i setup.py
        sed "/backports.csv/d" -i setup.py
    '';

    #phases = [ "unpackPhase" "configurePhase" "installPhase" "fixupPhase" "installCheckPhase" ];
    buildInputs = [ pytest responses ];
    propagatedBuildInputs = [
      six
      clint
      pyyaml
      docopt
      requests
      jsonpatch
      args
      schema
      backports_csv
    ];

    # Tests disabled because ia binary doesn't exist when tests run
    doCheck = false;

    checkPhase = "pytest tests";


  meta = with stdenv.lib; {
      description = "A python wrapper for the various Internet Archive APIs";
    homepage = https://github.com/jjjake/internetarchive;
    license = licenses.agpl3;
  };
}