10 buildAzureCliPackage = with py.pkgs; buildPythonPackage;
12 overrideAzureMgmtPackage =
13 package: version: extension: hash:
14 package.overridePythonAttrs (oldAttrs: {
18 inherit (oldAttrs) pname;
19 inherit version hash extension;
23 py = python3.override {
25 packageOverrides = self: super: {
26 inherit buildAzureCliPackage;
28 # core and the actual application are highly coupled
29 azure-cli-core = buildAzureCliPackage {
30 pname = "azure-cli-core";
33 sourceRoot = "${src.name}/src/azure-cli-core";
36 # Adding the possibility to configure an immutable configuration dir via `AZURE_IMMUTABLE_DIR`.
37 # This enables us to place configuration files that alter the behavior of the CLI in the Nix store.
39 # This is a downstream patch without an commit or PR upstream.
40 # There is an issue to discuss possible solutions upstream:
41 # https://github.com/Azure/azure-cli/issues/28093
42 ./0001-optional-immutable-configuration-dir.patch
45 propagatedBuildInputs =
57 microsoft-security-utilities-secret-masker
69 ++ requests.optional-dependencies.socks;
71 nativeCheckInputs = with self; [ pytest ];
73 doCheck = stdenv.hostPlatform.isLinux;
75 # ignore tests that does network call, or assume powershell
77 python -c 'import azure.common; print(azure.common)'
79 PYTHONPATH=$PWD:${src}/src/azure-cli-testsdk:$PYTHONPATH HOME=$TMPDIR pytest \
80 azure/cli/core/tests \
81 --ignore=azure/cli/core/tests/test_profile.py \
82 --ignore=azure/cli/core/tests/test_generic_update.py \
83 --ignore=azure/cli/core/tests/test_cloud.py \
84 --ignore=azure/cli/core/tests/test_extension.py \
85 -k 'not metadata_url and not test_send_raw_requests and not test_format_styled_text_legacy_powershell'
88 pythonImportsCheck = [
93 meta.downloadPage = "https://github.com/Azure/azure-cli/tree/azure-cli-${version}/src/azure-cli-core/";
96 azure-cli-telemetry = buildAzureCliPackage {
97 pname = "azure-cli-telemetry";
101 sourceRoot = "${src.name}/src/azure-cli-telemetry";
103 propagatedBuildInputs = with self; [
108 nativeCheckInputs = with self; [ pytest ];
112 HOME=$TMPDIR pytest -k 'not test_create_telemetry_note_file_from_scratch'
115 meta.downloadPage = "https://github.com/Azure/azure-cli/blob/azure-cli-${version}/src/azure-cli-telemetry/";
118 # AttributeError: type object 'WorkspacesOperations' has no attribute 'begin_delete'
120 overrideAzureMgmtPackage super.azure-mgmt-batchai "7.0.0b1" "zip"
121 "sha256-mT6vvjWbq0RWQidugR229E8JeVEiobPD3XA/nDM3I6Y=";
124 (overrideAzureMgmtPackage super.azure-mgmt-billing "6.0.0" "zip"
125 "sha256-1PXFpBiKRW/h6zK2xF9VyiBpx0vkHrdpIYQLOfL1wH8="
126 ).overridePythonAttrs
128 propagatedBuildInputs = attrs.propagatedBuildInputs or [ ] ++ [
134 # AttributeError: type object 'CustomDomainsOperations' has no attribute 'disable_custom_https'
136 overrideAzureMgmtPackage super.azure-mgmt-cdn "12.0.0" "zip"
137 "sha256-t8PuIYkjS0r1Gs4pJJJ8X9cz8950imQtbVBABnyMnd0=";
139 # ImportError: cannot import name 'SqlDedicatedGatewayServiceResourceCreateUpdateProperties' from 'azure.mgmt.cosmosdb.models'
140 azure-mgmt-cosmosdb =
141 overrideAzureMgmtPackage super.azure-mgmt-cosmosdb "9.5.1" "tar.gz"
142 "sha256-TlXTlz8RzwLPeoBVruhmFSM9fL47siegfBdrrIvH7wI=";
144 # ValueError: The operation 'azure.mgmt.devtestlabs.operations#VirtualMachinesOperations.delete' is invalid.
145 azure-mgmt-devtestlabs =
146 overrideAzureMgmtPackage super.azure-mgmt-devtestlabs "4.0.0" "zip"
147 "sha256-WVScTEBo8mRmsQl7V0qOUJn7LNbIvgoAOVsG07KeJ40=";
149 # ImportError: cannot import name 'ResourceSku' from 'azure.mgmt.eventgrid.models'
150 azure-mgmt-eventgrid =
151 overrideAzureMgmtPackage super.azure-mgmt-eventgrid "10.2.0b2" "zip"
152 "sha256-QcHY1wCwQyVOEdUi06/wEa4dqJH5Ccd33gJ1Sju0qZA=";
154 # ValueError: The operation 'azure.mgmt.hdinsight.operations#ExtensionsOperations.get_azure_monitor_agent_status' is invalid.
155 azure-mgmt-hdinsight =
156 overrideAzureMgmtPackage super.azure-mgmt-hdinsight "9.0.0b3" "tar.gz"
157 "sha256-clSeCP8+7T1uI4Nec+zhzDK980C9+JGeeJFsNSwgD2Q=";
159 # ValueError: The operation 'azure.mgmt.kusto.operations#ClustersOperations.delete' is invalid.
161 (overrideAzureMgmtPackage super.azure-mgmt-kusto "0.3.0" "zip"
162 "sha256-nri3eB/UQQ7p4gfNDDmDuvnlhBS1tKGISdCYVuNrrN4="
163 ).overridePythonAttrs
165 propagatedBuildInputs = attrs.propagatedBuildInputs or [ ] ++ [
171 # ValueError: The operation 'azure.mgmt.media.operations#MediaservicesOperations.create_or_update' is invalid.
173 overrideAzureMgmtPackage super.azure-mgmt-media "9.0.0" "zip"
174 "sha256-TI7l8sSQ2QUgPqiE3Cu/F67Wna+KHbQS3fuIjOb95ZM=";
176 # AttributeError: module 'azure.mgmt.rdbms.postgresql_flexibleservers.operations' has no attribute 'BackupsOperations'
178 overrideAzureMgmtPackage super.azure-mgmt-rdbms "10.2.0b16" "tar.gz"
179 "sha256-HDktzv8MOs5VRQArbS3waMhjbwVgZMmvch7PXen5DjE=";
181 # ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'
182 azure-mgmt-resource =
183 overrideAzureMgmtPackage super.azure-mgmt-resource "23.1.1" "tar.gz"
184 "sha256-ILawBrVE/bGWB/P2o4EQViXgu2D78wNvOYhcRkbTND4=";
186 # ImportError: cannot import name 'Replica' from 'azure.mgmt.signalr.models'
188 overrideAzureMgmtPackage super.azure-mgmt-signalr "2.0.0b1" "tar.gz"
189 "sha256-oK2ceBEoQ7gAeG6mye+x8HPzQU9bUNRPVJtRW2GL4xg=";
191 # ImportError: cannot import name 'AdvancedThreatProtectionName' from 'azure.mgmt.sql.models'
193 overrideAzureMgmtPackage super.azure-mgmt-sql "4.0.0b17" "tar.gz"
194 "sha256-i9VNbYJ3TgzURbtYYrXw+ez4ubK7BH39/EIL5kqb9Xg=";
196 # ValueError: The operation 'azure.mgmt.sqlvirtualmachine.operations#SqlVirtualMachinesOperations.begin_create_or_update' is invalid.
197 azure-mgmt-sqlvirtualmachine =
198 overrideAzureMgmtPackage super.azure-mgmt-sqlvirtualmachine "1.0.0b5" "zip"
199 "sha256-ZFgJflgynRSxo+B+Vso4eX1JheWlDQjfJ9QmupXypMc=";
201 # ModuleNotFoundError: No module named 'azure.mgmt.synapse.operations._kusto_pool_attached_database_configurations_operations'
203 overrideAzureMgmtPackage super.azure-mgmt-synapse "2.1.0b5" "zip"
204 "sha256-5E6Yf1GgNyNVjd+SeFDbhDxnOA6fOAG6oojxtCP4m+k=";