Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / azure-core / default.nix
blob90a16ee0982046c9305bef22750b923d83a9be13
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 , setuptools
16 , six
17 , trio
18 , typing-extensions
21 buildPythonPackage rec {
22   version = "1.30.1";
23   pname = "azure-core";
24   pyproject = true;
26   disabled = pythonOlder "3.7";
28   __darwinAllowLocalNetworking = true;
30   src = fetchPypi {
31     inherit pname version;
32     hash = "sha256-Jic6JUEx+EJp6OpEZPNWDHMfKcDB9prJkBCEXyOcGo8=";
33   };
35   nativeBuildInputs = [
36     setuptools
37   ];
39   propagatedBuildInputs = [
40     requests
41     six
42     typing-extensions
43   ];
45   passthru.optional-dependencies = {
46     aio = [
47       aiohttp
48     ];
49   };
51   nativeCheckInputs = [
52     aiodns
53     flask
54     mock
55     pytest
56     pytest-trio
57     pytest-asyncio
58     pytestCheckHook
59     trio
60   ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
62   # test server needs to be available
63   preCheck = ''
64     export PYTHONPATH=tests/testserver_tests/coretestserver:$PYTHONPATH
65   '';
67   pytestFlagsArray = [
68     "tests/"
69   ];
71   # disable tests which touch network
72   disabledTests = [
73     "aiohttp"
74     "multipart_send"
75     "response"
76     "request"
77     "timeout"
78     "test_sync_transport_short_read_download_stream"
79     "test_aio_transport_short_read_download_stream"
80   # disable 8 tests failing on some darwin machines with errors:
81   # azure.core.polling.base_polling.BadStatus: Invalid return status 403 for 'GET' operation
82   # azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Forbidden'
83   ] ++ lib.optionals stdenv.isDarwin [
84     "location_polling_fail"
85   ];
87   disabledTestPaths = [
88     # requires testing modules which aren't published, and likely to create cyclic dependencies
89     "tests/test_connection_string_parsing.py"
90     # wants network
91     "tests/async_tests/test_streaming_async.py"
92     "tests/test_streaming.py"
93     # testserver tests require being in a very specific working directory to make it work
94     "tests/testserver_tests/"
95     # requires missing pytest plugin
96     "tests/async_tests/test_rest_asyncio_transport.py"
97     # needs msrest, which cannot be included in nativeCheckInputs due to circular dependency new in msrest 0.7.1
98     # azure-core needs msrest which needs azure-core
99     "tests/test_polling.py"
100     "tests/async_tests/test_base_polling_async.py"
101     "tests/async_tests/test_polling_async.py"
102   ];
104   meta = with lib; {
105     description = "Microsoft Azure Core Library for Python";
106     homepage = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core";
107     changelog = "https://github.com/Azure/azure-sdk-for-python/blob/azure-core_${version}/sdk/core/azure-core/CHANGELOG.md";
108     license = licenses.mit;
109     maintainers = with maintainers; [ jonringer ];
110   };