1{ buildPythonPackage, pythonAtLeast, pytest, requests, requests_oauthlib, six
2, fetchFromGitHub, responses, lib
3}:
4
5buildPythonPackage rec {
6 pname = "asana";
7 version = "0.10.3";
8
9 # upstream reportedly doesn't support 3.7 yet, blocked on
10 # https://bugs.python.org/issue34226
11 disabled = pythonAtLeast "3.7";
12
13 src = fetchFromGitHub {
14 owner = "asana";
15 repo = "python-asana";
16 rev = "v${version}";
17 sha256 = "11nsfygcfpc2qb2gy4npi9w00cqfh88g7k3rsfq7xambz1zjdz1n";
18 };
19
20 checkInputs = [ pytest responses ];
21 propagatedBuildInputs = [ requests requests_oauthlib six ];
22
23 postPatch = ''
24 substituteInPlace setup.py \
25 --replace "requests_oauthlib >= 0.8.0, == 0.8.*" "requests_oauthlib>=0.8.0<2.0"
26 '';
27
28 checkPhase = ''
29 py.test tests
30 '';
31
32 meta = with lib; {
33 description = "Python client library for Asana";
34 homepage = "https://github.com/asana/python-asana";
35 license = licenses.mit;
36 };
37}