pythonPackages.asana: fix build

Fetching sources from GitHub to have needed files like `LICENSE` and
tests available to provide safer builds.

See https://hydra.nixos.org/build/70676254/log
See ticket #36453
This commit is contained in:
Maximilian Bosch 2018-03-10 23:22:35 +01:00
parent 3ab34a01e0
commit 17e1795db0
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchPypi, { lib, buildPythonPackage, pytest, requests, requests_oauthlib, six
pytest, requests, requests_oauthlib, six , fetchFromGitHub, responses, stdenv
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -7,18 +7,14 @@ buildPythonPackage rec {
version = "0.7.0"; version = "0.7.0";
name = "${pname}-${version}"; name = "${pname}-${version}";
meta = { src = fetchFromGitHub {
description = "Python client library for Asana"; owner = "asana";
homepage = https://github.com/asana/python-asana; repo = "python-asana";
license = lib.licenses.mit; rev = "v${version}";
sha256 = "0786y3wxqxxhsb0kkpx4bfzif3dhvv3dmm6vnq58iyj94862kpxf";
}; };
src = fetchPypi { checkInputs = [ pytest responses ];
inherit pname version;
sha256 = "a7ff4a78529257a5412e78cafd6b3025523364c0ab628d579f2771dd66b254bc";
};
checkInputs = [ pytest ];
propagatedBuildInputs = [ requests requests_oauthlib six ]; propagatedBuildInputs = [ requests requests_oauthlib six ];
patchPhase = '' patchPhase = ''
@ -27,11 +23,13 @@ buildPythonPackage rec {
sed -i "s/requests_oauthlib~=0.6.1/requests_oauthlib >=0.6.1/" setup.py sed -i "s/requests_oauthlib~=0.6.1/requests_oauthlib >=0.6.1/" setup.py
''; '';
# ERROR: file not found: tests
doCheck = false;
checkPhase = '' checkPhase = ''
py.test tests py.test tests
''; '';
meta = with stdenv.lib; {
description = "Python client library for Asana";
homepage = https://github.com/asana/python-asana;
license = licenses.mit;
};
} }