2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-10-09 19:29:22 +00:00
|
|
|
, python3
|
|
|
|
, fetchPypi
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchpatch
|
2023-10-09 19:29:22 +00:00
|
|
|
, src
|
|
|
|
, version
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-06-26 10:26:21 +00:00
|
|
|
buildAzureCliPackage = with py.pkgs; buildPythonPackage;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
overrideAzureMgmtPackage = package: version: extension: hash:
|
2023-11-16 04:20:00 +00:00
|
|
|
package.overridePythonAttrs (oldAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (oldAttrs) pname;
|
2023-03-15 16:39:30 +00:00
|
|
|
inherit version hash extension;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
py = python3.override {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
inherit buildAzureCliPackage;
|
|
|
|
|
|
|
|
# core and the actual application are highly coupled
|
|
|
|
azure-cli-core = buildAzureCliPackage {
|
|
|
|
pname = "azure-cli-core";
|
|
|
|
inherit version src;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
sourceRoot = "${src.name}/src/azure-cli-core";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
# Adding the possibility to configure an immutable configuration dir via `AZURE_IMMUTABLE_DIR`.
|
|
|
|
# This enables us to place configuration files that alter the behavior of the CLI in the Nix store.
|
|
|
|
#
|
|
|
|
# This is a downstream patch without an commit or PR upstream.
|
|
|
|
# There is an issue to discuss possible solutions upstream:
|
|
|
|
# https://github.com/Azure/azure-cli/issues/28093
|
|
|
|
./0001-optional-immutable-configuration-dir.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = with self; [
|
|
|
|
argcomplete
|
|
|
|
azure-cli-telemetry
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-common
|
2020-05-03 17:38:23 +00:00
|
|
|
azure-mgmt-core
|
2021-03-15 08:37:03 +00:00
|
|
|
cryptography
|
2023-07-15 17:15:38 +00:00
|
|
|
distro
|
2020-04-24 23:36:52 +00:00
|
|
|
humanfriendly
|
|
|
|
jmespath
|
|
|
|
knack
|
2020-05-29 06:06:01 +00:00
|
|
|
msal-extensions
|
2023-11-16 04:20:00 +00:00
|
|
|
msal
|
2020-04-24 23:36:52 +00:00
|
|
|
msrestazure
|
2023-11-16 04:20:00 +00:00
|
|
|
packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
paramiko
|
2020-05-03 17:38:23 +00:00
|
|
|
pkginfo
|
2020-04-24 23:36:52 +00:00
|
|
|
psutil
|
|
|
|
pyjwt
|
|
|
|
pyopenssl
|
|
|
|
requests
|
2021-12-19 01:06:50 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with self; [ pytest ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = stdenv.isLinux;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# ignore tests that does network call, or assume powershell
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
python -c 'import azure.common; print(azure.common)'
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
PYTHONPATH=$PWD:${src}/src/azure-cli-testsdk:$PYTHONPATH HOME=$TMPDIR pytest \
|
|
|
|
azure/cli/core/tests \
|
2020-04-24 23:36:52 +00:00
|
|
|
--ignore=azure/cli/core/tests/test_profile.py \
|
2020-10-07 09:15:18 +00:00
|
|
|
--ignore=azure/cli/core/tests/test_generic_update.py \
|
2024-02-07 01:22:34 +00:00
|
|
|
--ignore=azure/cli/core/tests/test_cloud.py \
|
|
|
|
--ignore=azure/cli/core/tests/test_extension.py \
|
2021-09-18 10:52:07 +00:00
|
|
|
-k 'not metadata_url and not test_send_raw_requests and not test_format_styled_text_legacy_powershell'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"azure.cli.telemetry"
|
|
|
|
"azure.cli.core"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
azure-cli-telemetry = buildAzureCliPackage {
|
|
|
|
pname = "azure-cli-telemetry";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
sourceRoot = "${src.name}/src/azure-cli-telemetry";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with self; [
|
2020-04-24 23:36:52 +00:00
|
|
|
applicationinsights
|
|
|
|
portalocker
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeCheckInputs = with self; [ pytest ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# ignore flaky test
|
|
|
|
checkPhase = ''
|
|
|
|
cd azure
|
|
|
|
HOME=$TMPDIR pytest -k 'not test_create_telemetry_note_file_from_scratch'
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-keyvault-keys = overrideAzureMgmtPackage super.azure-keyvault-keys "4.9.0b3" "tar.gz" "sha256-qoseyf6WqBEG8vPc1hF17K46AWk8Ba8V9KRed4lOlGo=";
|
|
|
|
azure-mgmt-applicationinsights = overrideAzureMgmtPackage super.azure-mgmt-applicationinsights "1.0.0" "zip" "sha256-woeix9703hn5LAwxugKGf6xvW433G129qxkoi7RV/Fs=";
|
2024-05-15 15:35:15 +00:00
|
|
|
azure-mgmt-batch = overrideAzureMgmtPackage super.azure-mgmt-batch "17.3.0" "tar.gz" "sha256-/JSIGmrNuKlTPzcbb3stPq6heJ65VQFLJKkI1t/nWZE=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-batchai = overrideAzureMgmtPackage super.azure-mgmt-batchai "7.0.0b1" "zip" "sha256-mT6vvjWbq0RWQidugR229E8JeVEiobPD3XA/nDM3I6Y=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-botservice = overrideAzureMgmtPackage super.azure-mgmt-botservice "2.0.0b3" "zip" "sha256-XZGQOeMw8usyQ1tl8j57fZ3uqLshomHY9jO/rbpQOvM=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-cdn = overrideAzureMgmtPackage super.azure-mgmt-cdn "12.0.0" "zip" "sha256-t8PuIYkjS0r1Gs4pJJJ8X9cz8950imQtbVBABnyMnd0=";
|
2024-06-20 14:57:18 +00:00
|
|
|
azure-mgmt-compute = overrideAzureMgmtPackage super.azure-mgmt-compute "31.0.0" "tar.gz" "sha256-WlscT8GhnssCKhLe0b6LGxVfaXnQP7nvwEZC9gZkS78=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-core = overrideAzureMgmtPackage super.azure-mgmt-core "1.3.2" "zip" "sha256-B/Sv6COlXXBLBI1h7f3BMYwFHtWfJEAyEmNQvpXp1QE=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-datalake-store = overrideAzureMgmtPackage super.azure-mgmt-datalake-store "0.5.0" "zip" "sha256-k3bTVJVmHRn4rMVgT2ewvFlJOxg1u8SA+aGVL5ABekw=";
|
|
|
|
azure-mgmt-devtestlabs = overrideAzureMgmtPackage super.azure-mgmt-devtestlabs "4.0.0" "zip" "sha256-WVScTEBo8mRmsQl7V0qOUJn7LNbIvgoAOVsG07KeJ40=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-dns = overrideAzureMgmtPackage super.azure-mgmt-dns "8.0.0" "zip" "sha256-QHwtrLM1E/++nKS+Wt216dS64Mt++mE8P31THve/jeg=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-eventgrid = overrideAzureMgmtPackage super.azure-mgmt-eventgrid "10.2.0b2" "zip" "sha256-QcHY1wCwQyVOEdUi06/wEa4dqJH5Ccd33gJ1Sju0qZA=";
|
|
|
|
azure-mgmt-eventhub = overrideAzureMgmtPackage super.azure-mgmt-eventhub "10.1.0" "zip" "sha256-MZqhSBkwypvEefhoEWEPsBUFidWYD7qAX6edcBDDSSA=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-extendedlocation = overrideAzureMgmtPackage super.azure-mgmt-extendedlocation "1.0.0b2" "zip" "sha256-mjfH35T81JQ97jVgElWmZ8P5MwXVxZQv/QJKNLS3T8A=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-iotcentral = overrideAzureMgmtPackage super.azure-mgmt-iotcentral "10.0.0b1" "zip" "sha256-1CiZuTXYhIb74eGQZUJHHzovYNnnVd3Ydu1UCy2Bu00=";
|
|
|
|
azure-mgmt-kusto = (overrideAzureMgmtPackage super.azure-mgmt-kusto "0.3.0" "zip"
|
|
|
|
"sha256-nri3eB/UQQ7p4gfNDDmDuvnlhBS1tKGISdCYVuNrrN4=").overridePythonAttrs (attrs: {
|
|
|
|
propagatedBuildInputs = attrs.propagatedBuildInputs or [ ] ++ [ self.msrest self.msrestazure ];
|
|
|
|
});
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-maps = overrideAzureMgmtPackage super.azure-mgmt-maps "2.0.0" "zip" "sha256-OE4X92potwCk+YhHiUXDqXIXEcBAByWv38tjz4ToXw4=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-media = overrideAzureMgmtPackage super.azure-mgmt-media "9.0.0" "zip" "sha256-TI7l8sSQ2QUgPqiE3Cu/F67Wna+KHbQS3fuIjOb95ZM=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-monitor = overrideAzureMgmtPackage super.azure-mgmt-monitor "5.0.0" "zip" "sha256-eL9KJowxTF7hZJQQQCNJZ7l+rKPFM8wP5vEigt3ZFGE=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-netapp = overrideAzureMgmtPackage super.azure-mgmt-netapp "10.1.0" "zip" "sha256-eJiWTOCk2C79Jotku9bKlu3vU6H8004hWrX+h76MjQM=";
|
|
|
|
azure-mgmt-policyinsights = overrideAzureMgmtPackage super.azure-mgmt-policyinsights "1.1.0b4" "zip" "sha256-aB16xyrhNYHJeitvdCeV+kik21B2LC+5/OSDQIGwTpI=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-privatedns = overrideAzureMgmtPackage super.azure-mgmt-privatedns "1.0.0" "zip" "sha256-tg8W5D97KRWCxfV7rhsIMJbYMD6dmVjiwpInpVzCfEU=";
|
2024-06-20 14:57:18 +00:00
|
|
|
azure-mgmt-rdbms = overrideAzureMgmtPackage super.azure-mgmt-rdbms "10.2.0b16" "tar.gz" "sha256-HDktzv8MOs5VRQArbS3waMhjbwVgZMmvch7PXen5DjE=";
|
2024-05-15 15:35:15 +00:00
|
|
|
azure-mgmt-recoveryservicesbackup = overrideAzureMgmtPackage super.azure-mgmt-recoveryservicesbackup "9.1.0" "tar.gz" "sha256-Hp/UBsDJ7iYn9aNx8BL4dzQvf8bzOyVk/NFNbwZjzQ8=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-redis = overrideAzureMgmtPackage super.azure-mgmt-redis "14.3.0" "tar.gz" "sha256-eoMbY4oNzYXkn3uFUhxecJQD+BxYkGTbWhAWSgAoLyA=";
|
2024-06-20 14:57:18 +00:00
|
|
|
azure-mgmt-resource = overrideAzureMgmtPackage super.azure-mgmt-resource "23.1.1" "tar.gz" "sha256-ILawBrVE/bGWB/P2o4EQViXgu2D78wNvOYhcRkbTND4=";
|
2024-01-02 11:29:13 +00:00
|
|
|
azure-mgmt-search = overrideAzureMgmtPackage super.azure-mgmt-search "9.0.0" "zip" "sha256-Gc+qoTa1EE4/YmJvUSqVG+zZ50wfohvWOe/fLJ/vgb0=";
|
2024-06-20 14:57:18 +00:00
|
|
|
azure-mgmt-security = overrideAzureMgmtPackage super.azure-mgmt-security "6.0.0" "tar.gz" "sha256-zq/BhpiZBnEQvYMMXMmLybjzLY6oQMofaTsaX1Kl+LA=";
|
|
|
|
azure-mgmt-servicefabric = overrideAzureMgmtPackage super.azure-mgmt-servicefabric "2.1.0" "tar.gz" "sha256-oIQzBJVUQ2yQhEvIqWgg6INplITm/8mQMv0lcfjF99Y=";
|
2024-05-15 15:35:15 +00:00
|
|
|
azure-mgmt-servicelinker = overrideAzureMgmtPackage super.azure-mgmt-servicelinker "1.2.0b2" "tar.gz" "sha256-PpEFMM8ri9OgAa79dGhvPKy5YFfDZZustBUDieQrtZU=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-signalr = overrideAzureMgmtPackage super.azure-mgmt-signalr "2.0.0b1" "tar.gz" "sha256-oK2ceBEoQ7gAeG6mye+x8HPzQU9bUNRPVJtRW2GL4xg=";
|
2024-05-15 15:35:15 +00:00
|
|
|
azure-mgmt-sql = overrideAzureMgmtPackage super.azure-mgmt-sql "4.0.0b16" "tar.gz" "sha256-+6QKEROlbXe0oCj4qtB+r4/yCPZD4N+71e5Z1Z/zXV0=";
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-mgmt-sqlvirtualmachine = overrideAzureMgmtPackage super.azure-mgmt-sqlvirtualmachine "1.0.0b5" "zip" "sha256-ZFgJflgynRSxo+B+Vso4eX1JheWlDQjfJ9QmupXypMc=";
|
|
|
|
azure-mgmt-storage = overrideAzureMgmtPackage super.azure-mgmt-storage "21.1.0" "tar.gz" "sha256-1tPA6RfJiLye0Eckd9PvP5CIYAnrHZenEZRPg3VjAWI=";
|
|
|
|
azure-mgmt-synapse = overrideAzureMgmtPackage super.azure-mgmt-synapse "2.1.0b5" "zip" "sha256-5E6Yf1GgNyNVjd+SeFDbhDxnOA6fOAG6oojxtCP4m+k=";
|
|
|
|
azure-mgmt-trafficmanager = overrideAzureMgmtPackage super.azure-mgmt-trafficmanager "1.0.0" "zip" "sha256-R0F2HoA0bE7dTLPycTaOqYBj+ATQFeJFwv4EjtK1lqg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
azure-storage-common = overrideAzureMgmtPackage super.azure-storage-common "1.4.2" "tar.gz" "sha256-Tsh8dTfUV+yVJS4ORkd+LBzPM3dP/v0F2FRGgssK5AE=";
|
|
|
|
azure-synapse-accesscontrol = overrideAzureMgmtPackage super.azure-synapse-accesscontrol "0.5.0" "zip" "sha256-g14ySiByqPgkJGRH8EnIRJO9Q6H2usS5FOeMCQiUuwQ=";
|
|
|
|
azure-synapse-spark = overrideAzureMgmtPackage super.azure-synapse-spark "0.2.0" "zip" "sha256-OQ5brhweEIrtN2iP4I5NacdC9t3YUiGIVhhqSs3FMuI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
2023-10-09 19:29:22 +00:00
|
|
|
py
|