1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, aiodns
7, aiohttp
8, flask
9, mock
10, pytest
11, pytest-asyncio
12, pytest-trio
13, pytestCheckHook
14, requests
15, six
16, trio
17, typing-extensions }:
18
19buildPythonPackage rec {
20 version = "1.25.1";
21 pname = "azure-core";
22 disabled = pythonOlder "3.6";
23
24 src = fetchPypi {
25 inherit pname version;
26 extension = "zip";
27 sha256 = "sha256-PBzzaGUOduwAnAfNEXSpXNy0cbJHu3LRgkX31WwYCbI=";
28 };
29
30 propagatedBuildInputs = [
31 requests
32 six
33 typing-extensions
34 ];
35
36 checkInputs = [
37 aiodns
38 aiohttp
39 flask
40 mock
41 pytest
42 pytest-trio
43 pytest-asyncio
44 pytestCheckHook
45 trio
46 ];
47
48 # test server needs to be available
49 preCheck = ''
50 export PYTHONPATH=tests/testserver_tests/coretestserver:$PYTHONPATH
51 '';
52
53 pytestFlagsArray = [ "tests/" ];
54 # disable tests which touch network
55 disabledTests = [
56 "aiohttp"
57 "multipart_send"
58 "response"
59 "request"
60 "timeout"
61 "test_sync_transport_short_read_download_stream"
62 "test_aio_transport_short_read_download_stream"
63 # disable 8 tests failing on some darwin machines with errors:
64 # azure.core.polling.base_polling.BadStatus: Invalid return status 403 for 'GET' operation
65 # azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Forbidden'
66 ] ++ lib.optionals stdenv.isDarwin [
67 "location_polling_fail"
68 ];
69 disabledTestPaths = [
70 # requires testing modules which aren't published, and likely to create cyclic dependencies
71 "tests/test_connection_string_parsing.py"
72 # wants network
73 "tests/async_tests/test_streaming_async.py"
74 "tests/test_streaming.py"
75 # testserver tests require being in a very specific working directory to make it work
76 "tests/testserver_tests/"
77 # requires missing pytest plugin
78 "tests/async_tests/test_rest_asyncio_transport.py"
79 # needs msrest, which cannot be included in checkInputs due to circular dependency new in msrest 0.7.1
80 # azure-core needs msrest which needs azure-core
81 "tests/test_polling.py"
82 "tests/async_tests/test_base_polling_async.py"
83 "tests/async_tests/test_polling_async.py"
84 ];
85
86 meta = with lib; {
87 description = "Microsoft Azure Core Library for Python";
88 homepage = "https://github.com/Azure/azure-sdk-for-python";
89 license = licenses.mit;
90 maintainers = with maintainers; [ jonringer ];
91 };
92}