summary refs log tree commit diff
path: root/pkgs/development/python-modules/asana/default.nix
blob: 62b176fb59c6810826dcc5f1943182a898afeb16 (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
{ lib, buildPythonPackage, pytest, requests, requests_oauthlib, six
, fetchFromGitHub, responses, stdenv
}:

buildPythonPackage rec {
  pname = "asana";
  version = "0.7.0";
  name = "${pname}-${version}";

  src = fetchFromGitHub {
    owner = "asana";
    repo = "python-asana";
    rev = "v${version}";
    sha256 = "0786y3wxqxxhsb0kkpx4bfzif3dhvv3dmm6vnq58iyj94862kpxf";
  };

  checkInputs = [ pytest responses ];
  propagatedBuildInputs = [ requests requests_oauthlib six ];

  patchPhase = ''
    echo > requirements.txt
    sed -i "s/requests~=2.9.1/requests >=2.9.1/" setup.py
    sed -i "s/requests_oauthlib~=0.6.1/requests_oauthlib >=0.6.1/" setup.py
  '';

  checkPhase = ''
    py.test tests
  '';

  meta = with stdenv.lib; {
    description = "Python client library for Asana";
    homepage = https://github.com/asana/python-asana;
    license = licenses.mit;
  };
}