2019-03-19 15:58:12 +01:00
|
|
|
{ lib
|
2018-12-20 00:06:57 +01:00
|
|
|
, buildPythonPackage
|
2019-03-19 15:58:12 +01:00
|
|
|
, fetchFromGitHub
|
2019-03-19 16:38:39 +01:00
|
|
|
, pythonAtLeast
|
2019-03-19 15:58:12 +01:00
|
|
|
, requests
|
2018-12-20 00:06:57 +01:00
|
|
|
, requests_oauthlib
|
|
|
|
, isodate
|
2019-03-19 15:58:12 +01:00
|
|
|
, certifi
|
|
|
|
, aiohttp
|
|
|
|
, aiodns
|
|
|
|
, pytest
|
|
|
|
, httpretty
|
2019-03-19 16:38:39 +01:00
|
|
|
, trio
|
2018-12-20 00:06:57 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2019-03-19 15:58:12 +01:00
|
|
|
version = "0.6.4";
|
2018-12-20 00:06:57 +01:00
|
|
|
pname = "msrest";
|
|
|
|
|
2019-03-19 16:38:39 +01:00
|
|
|
# no tests in PyPI tarball
|
|
|
|
# see https://github.com/Azure/msrest-for-python/pull/152
|
2019-03-19 15:58:12 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Azure";
|
|
|
|
repo = "msrest-for-python";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0ilrc06qq0dw4qqzq1dq2vs6nymc39h19w52dwcyawwfalalnjzi";
|
2018-12-20 00:06:57 +01:00
|
|
|
};
|
|
|
|
|
2019-03-19 15:58:12 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests requests_oauthlib isodate certifi
|
|
|
|
# optional
|
|
|
|
aiohttp aiodns
|
|
|
|
];
|
|
|
|
|
2019-03-19 16:38:39 +01:00
|
|
|
checkInputs = [ pytest httpretty ]
|
|
|
|
++ lib.optional (pythonAtLeast "3.5") trio;
|
2019-03-19 15:58:12 +01:00
|
|
|
|
2019-03-19 16:38:39 +01:00
|
|
|
# Deselected tests require network access
|
2019-03-19 15:58:12 +01:00
|
|
|
checkPhase = ''
|
2019-03-19 16:38:39 +01:00
|
|
|
pytest tests/ -k "not test_conf_async_trio_requests"
|
2019-03-19 15:58:12 +01:00
|
|
|
'';
|
2018-12-20 00:06:57 +01:00
|
|
|
|
2019-03-19 15:58:12 +01:00
|
|
|
meta = with lib; {
|
2018-12-20 00:06:57 +01:00
|
|
|
description = "The runtime library 'msrest' for AutoRest generated Python clients.";
|
|
|
|
homepage = "https://azure.microsoft.com/en-us/develop/python/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bendlas ];
|
|
|
|
};
|
|
|
|
}
|