Merge pull request from superherointj/azure-cli-remove-pins

azure-cli: remove unnecessary pins
This commit is contained in:
Paul Meyer 2024-07-17 17:28:27 +02:00 committed by GitHub
commit f9413a5099
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 116 additions and 154 deletions
pkgs
by-name/az/azure-cli
development/python-modules/azure-monitor-query
top-level

View File

@ -19,13 +19,12 @@
## Extensions
There are two sets of extensions: the one in `extensions-generated.nix` is generated with the script
`query-extension-index.sh`. These are extensions that don't have external requirements and thus can
be easily maintained and updated. The set should only be manipulated through an update based on the
script output.
There are two sets of extensions:
The other set of extensions is in `extensions-manual.nix`. These are extensions with requirements,
which need to be packaged and maintained manually.
- `extensions-generated.nix` are extensions with no external requirements, which can be regenerated running:
> nix run .#azure-cli.passthru.generate-extensions
- `extensions-manual.nix` are extensions with requirements, which need to be manually packaged and maintained.
### Adding an extension to `extensions-manual.nix`

View File

@ -1,9 +1,4 @@
# This file packages Azure CLI extensions that don't have any requirements.
# Extensions with requirements should be placed in another file, so this one
# can be re-generated during update.
#
# Attributes were generated using the query-extension-index.sh script:
# ./query-extension-index.sh --requirements=false --download --nix --cli-version=<version>
# This file is automatically generated. DO NOT EDIT! Read README.md
{ mkAzExtension }:
{
account = mkAzExtension rec {

View File

@ -8,6 +8,7 @@
runCommand,
installShellFiles,
python311,
writeScriptBin,
# Whether to include patches that enable placing certain behavior-defining
# configuration files in the Nix store.
@ -106,19 +107,16 @@ py.pkgs.toPythonApplication (
nativeBuildInputs = [ installShellFiles ];
# Dependencies from:
# https://github.com/Azure/azure-cli/blob/azure-cli-2.62.0/src/azure-cli/setup.py#L52
# Please, keep ordered by upstream file order. It facilitates reviews.
propagatedBuildInputs =
with py.pkgs;
[
antlr4-python3-runtime
applicationinsights
argcomplete
asn1crypto
azure-appconfiguration
azure-batch
azure-cli-core
azure-cli-telemetry
azure-common
azure-core
azure-cosmos
azure-data-tables
azure-datalake-store
@ -127,29 +125,24 @@ py.pkgs.toPythonApplication (
azure-keyvault-certificates
azure-keyvault-keys
azure-keyvault-secrets
azure-loganalytics
azure-mgmt-advisor
azure-mgmt-apimanagement
azure-mgmt-appconfiguration
azure-mgmt-appcontainers
azure-mgmt-applicationinsights
azure-mgmt-authorization
azure-mgmt-batch
azure-mgmt-batchai
azure-mgmt-batch
azure-mgmt-billing
azure-mgmt-botservice
azure-mgmt-cdn
azure-mgmt-cognitiveservices
azure-mgmt-compute
azure-mgmt-consumption
azure-mgmt-containerinstance
azure-mgmt-containerregistry
azure-mgmt-containerservice
azure-mgmt-core
azure-mgmt-cosmosdb
azure-mgmt-databoxedge
azure-mgmt-datalake-nspkg
azure-mgmt-datalake-store
azure-mgmt-datamigration
azure-mgmt-devtestlabs
azure-mgmt-dns
@ -164,8 +157,8 @@ py.pkgs.toPythonApplication (
azure-mgmt-keyvault
azure-mgmt-kusto
azure-mgmt-loganalytics
azure-mgmt-managementgroups
azure-mgmt-managedservices
azure-mgmt-managementgroups
azure-mgmt-maps
azure-mgmt-marketplaceordering
azure-mgmt-media
@ -175,81 +168,55 @@ py.pkgs.toPythonApplication (
azure-mgmt-policyinsights
azure-mgmt-privatedns
azure-mgmt-rdbms
azure-mgmt-recoveryservices
azure-mgmt-recoveryservicesbackup
azure-mgmt-redhatopenshift
azure-mgmt-recoveryservices
azure-mgmt-redis
azure-mgmt-relay
azure-mgmt-redhatopenshift
azure-mgmt-resource
azure-mgmt-search
azure-mgmt-security
azure-mgmt-servicebus
azure-mgmt-servicefabric
azure-mgmt-servicefabricmanagedclusters
azure-mgmt-servicelinker
azure-mgmt-sql
azure-mgmt-servicefabric
azure-mgmt-signalr
azure-mgmt-sqlvirtualmachine
azure-mgmt-sql
azure-mgmt-storage
azure-mgmt-synapse
azure-mgmt-trafficmanager
azure-mgmt-web
azure-monitor-query
azure-multiapi-storage
azure-nspkg
azure-storage-common
azure-storage-blob
azure-synapse-accesscontrol
azure-synapse-artifacts
azure-synapse-managedprivateendpoints
azure-synapse-spark
bcrypt
certifi
cffi
chardet
colorama
cryptography
distro
]
++ lib.optional stdenv.isLinux distro
++ [
fabric
humanfriendly
idna
invoke
isodate
javaproperties
jinja2
jmespath
jsondiff
knack
markupsafe
msal-extensions
msal
msrest
msrestazure
oauthlib
packaging
paramiko
pbr
pkginfo
portalocker
psutil
pycomposefile
pycparser
pygithub
pyjwt
pynacl
pyopenssl
python-dateutil
requests-oauthlib
requests
scp
semver
setuptools
six
sshtunnel
tabulate
urllib3
wcwidth
websocket-client
xmltodict
# Other dependencies
pyopenssl # Used at: https://github.com/Azure/azure-cli/blob/azure-cli-2.62.0/src/azure-cli/azure/cli/command_modules/servicefabric/custom.py#L11
setuptools # ModuleNotFoundError: No module named 'pkg_resources'
]
++ lib.optionals (!withImmutableConfig) [
# pip is required to install extensions locally, but it's not needed if
@ -311,7 +278,6 @@ py.pkgs.toPythonApplication (
"azure.datalake.store"
"azure.graphrbac"
"azure.keyvault"
"azure.loganalytics"
"azure.mgmt.advisor"
"azure.mgmt.apimanagement"
"azure.mgmt.applicationinsights"
@ -325,12 +291,10 @@ py.pkgs.toPythonApplication (
"azure.mgmt.cdn"
"azure.mgmt.cognitiveservices"
"azure.mgmt.compute"
"azure.mgmt.consumption"
"azure.mgmt.containerinstance"
"azure.mgmt.containerregistry"
"azure.mgmt.containerservice"
"azure.mgmt.cosmosdb"
"azure.mgmt.datalake.store"
"azure.mgmt.datamigration"
"azure.mgmt.devtestlabs"
"azure.mgmt.dns"
@ -358,7 +322,6 @@ py.pkgs.toPythonApplication (
"azure.mgmt.recoveryservices"
"azure.mgmt.recoveryservicesbackup"
"azure.mgmt.redis"
"azure.mgmt.relay"
"azure.mgmt.resource"
"azure.mgmt.search"
"azure.mgmt.security"
@ -370,7 +333,7 @@ py.pkgs.toPythonApplication (
"azure.mgmt.storage"
"azure.mgmt.trafficmanager"
"azure.mgmt.web"
"azure.storage.blob"
"azure.monitor.query"
"azure.storage.common"
];
@ -413,9 +376,22 @@ py.pkgs.toPythonApplication (
touch $out
'';
};
generate-extensions = writeScriptBin "${pname}-update-extensions" ''
export FILE=extensions-generated.nix
echo "# This file is automatically generated. DO NOT EDIT! Read README.md" > $FILE
echo "{ mkAzExtension }:" >> $FILE
echo "{" >> $FILE
${./query-extension-index.sh} --requirements=false --download --nix --cli-version=${version} \
| xargs -n1 -d '\n' echo " " >> $FILE
echo "" >> $FILE
echo "}" >> $FILE
echo "Extension was saved to \"extensions-generated.nix\" file."
echo "Move it to \"{nixpkgs}/pkgs/by-name/az/azure-cli/extensions-generated.nix\"."
'';
};
meta = with lib; {
meta = {
homepage = "https://github.com/Azure/azure-cli";
description = "Next generation multi-platform command line experience for Azure";
downloadPage = "https://github.com/Azure/azure-cli/releases/tag/azure-cli-${version}";
@ -438,11 +414,11 @@ py.pkgs.toPythonApplication (
when building `azure-cli`.
'';
changelog = "https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md";
sourceProvenance = [ sourceTypes.fromSource ];
license = licenses.mit;
sourceProvenance = [ lib.sourceTypes.fromSource ];
license = lib.licenses.mit;
mainProgram = "az";
maintainers = with maintainers; [ katexochen ] ++ lib.teams.stridtech.members;
platforms = platforms.all;
maintainers = with lib.maintainers; [ katexochen ] ++ lib.teams.stridtech.members;
platforms = lib.platforms.all;
};
}
)

View File

@ -86,6 +86,8 @@ let
"azure.cli.telemetry"
"azure.cli.core"
];
meta.downloadPage = "https://github.com/Azure/azure-cli/tree/azure-cli-${version}/src/azure-cli-core/";
};
azure-cli-telemetry = buildAzureCliPackage {
@ -106,56 +108,36 @@ let
cd azure
HOME=$TMPDIR pytest -k 'not test_create_telemetry_note_file_from_scratch'
'';
meta.downloadPage = "https://github.com/Azure/azure-cli/blob/azure-cli-${version}/src/azure-cli-telemetry/";
};
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=";
azure-mgmt-batch =
overrideAzureMgmtPackage super.azure-mgmt-batch "17.3.0" "tar.gz"
"sha256-/JSIGmrNuKlTPzcbb3stPq6heJ65VQFLJKkI1t/nWZE=";
# AttributeError: type object 'WorkspacesOperations' has no attribute 'begin_delete'
azure-mgmt-batchai =
overrideAzureMgmtPackage super.azure-mgmt-batchai "7.0.0b1" "zip"
"sha256-mT6vvjWbq0RWQidugR229E8JeVEiobPD3XA/nDM3I6Y=";
azure-mgmt-botservice =
overrideAzureMgmtPackage super.azure-mgmt-botservice "2.0.0b3" "zip"
"sha256-XZGQOeMw8usyQ1tl8j57fZ3uqLshomHY9jO/rbpQOvM=";
# AttributeError: type object 'CustomDomainsOperations' has no attribute 'disable_custom_https'
azure-mgmt-cdn =
overrideAzureMgmtPackage super.azure-mgmt-cdn "12.0.0" "zip"
"sha256-t8PuIYkjS0r1Gs4pJJJ8X9cz8950imQtbVBABnyMnd0=";
azure-mgmt-compute =
overrideAzureMgmtPackage super.azure-mgmt-compute "31.0.0" "tar.gz"
"sha256-WlscT8GhnssCKhLe0b6LGxVfaXnQP7nvwEZC9gZkS78=";
azure-mgmt-core =
overrideAzureMgmtPackage super.azure-mgmt-core "1.3.2" "zip"
"sha256-B/Sv6COlXXBLBI1h7f3BMYwFHtWfJEAyEmNQvpXp1QE=";
# ImportError: cannot import name 'SqlDedicatedGatewayServiceResourceCreateUpdateProperties' from 'azure.mgmt.cosmosdb.models'
azure-mgmt-cosmosdb =
overrideAzureMgmtPackage super.azure-mgmt-cosmosdb "9.5.1" "tar.gz"
"sha256-TlXTlz8RzwLPeoBVruhmFSM9fL47siegfBdrrIvH7wI=";
azure-mgmt-datalake-store =
overrideAzureMgmtPackage super.azure-mgmt-datalake-store "0.5.0" "zip"
"sha256-k3bTVJVmHRn4rMVgT2ewvFlJOxg1u8SA+aGVL5ABekw=";
# ValueError: The operation 'azure.mgmt.devtestlabs.operations#VirtualMachinesOperations.delete' is invalid.
azure-mgmt-devtestlabs =
overrideAzureMgmtPackage super.azure-mgmt-devtestlabs "4.0.0" "zip"
"sha256-WVScTEBo8mRmsQl7V0qOUJn7LNbIvgoAOVsG07KeJ40=";
azure-mgmt-dns =
overrideAzureMgmtPackage super.azure-mgmt-dns "8.0.0" "zip"
"sha256-QHwtrLM1E/++nKS+Wt216dS64Mt++mE8P31THve/jeg=";
# ImportError: cannot import name 'ResourceSku' from 'azure.mgmt.eventgrid.models'
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=";
azure-mgmt-extendedlocation =
overrideAzureMgmtPackage super.azure-mgmt-extendedlocation "1.0.0b2" "zip"
"sha256-mjfH35T81JQ97jVgElWmZ8P5MwXVxZQv/QJKNLS3T8A=";
azure-mgmt-iotcentral =
overrideAzureMgmtPackage super.azure-mgmt-iotcentral "10.0.0b1" "zip"
"sha256-1CiZuTXYhIb74eGQZUJHHzovYNnnVd3Ydu1UCy2Bu00=";
# ValueError: The operation 'azure.mgmt.kusto.operations#ClustersOperations.delete' is invalid.
azure-mgmt-kusto =
(overrideAzureMgmtPackage super.azure-mgmt-kusto "0.3.0" "zip"
"sha256-nri3eB/UQQ7p4gfNDDmDuvnlhBS1tKGISdCYVuNrrN4="
@ -166,75 +148,41 @@ let
self.msrestazure
];
});
azure-mgmt-maps =
overrideAzureMgmtPackage super.azure-mgmt-maps "2.0.0" "zip"
"sha256-OE4X92potwCk+YhHiUXDqXIXEcBAByWv38tjz4ToXw4=";
# ValueError: The operation 'azure.mgmt.media.operations#MediaservicesOperations.create_or_update' is invalid.
azure-mgmt-media =
overrideAzureMgmtPackage super.azure-mgmt-media "9.0.0" "zip"
"sha256-TI7l8sSQ2QUgPqiE3Cu/F67Wna+KHbQS3fuIjOb95ZM=";
azure-mgmt-monitor =
overrideAzureMgmtPackage super.azure-mgmt-monitor "5.0.0" "zip"
"sha256-eL9KJowxTF7hZJQQQCNJZ7l+rKPFM8wP5vEigt3ZFGE=";
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=";
azure-mgmt-privatedns =
overrideAzureMgmtPackage super.azure-mgmt-privatedns "1.0.0" "zip"
"sha256-tg8W5D97KRWCxfV7rhsIMJbYMD6dmVjiwpInpVzCfEU=";
# AttributeError: module 'azure.mgmt.rdbms.postgresql_flexibleservers.operations' has no attribute 'BackupsOperations'
azure-mgmt-rdbms =
overrideAzureMgmtPackage super.azure-mgmt-rdbms "10.2.0b16" "tar.gz"
"sha256-HDktzv8MOs5VRQArbS3waMhjbwVgZMmvch7PXen5DjE=";
azure-mgmt-recoveryservicesbackup =
overrideAzureMgmtPackage super.azure-mgmt-recoveryservicesbackup "9.1.0" "tar.gz"
"sha256-Hp/UBsDJ7iYn9aNx8BL4dzQvf8bzOyVk/NFNbwZjzQ8=";
azure-mgmt-redis =
overrideAzureMgmtPackage super.azure-mgmt-redis "14.3.0" "tar.gz"
"sha256-eoMbY4oNzYXkn3uFUhxecJQD+BxYkGTbWhAWSgAoLyA=";
# ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'
azure-mgmt-resource =
overrideAzureMgmtPackage super.azure-mgmt-resource "23.1.1" "tar.gz"
"sha256-ILawBrVE/bGWB/P2o4EQViXgu2D78wNvOYhcRkbTND4=";
azure-mgmt-search =
overrideAzureMgmtPackage super.azure-mgmt-search "9.0.0" "zip"
"sha256-Gc+qoTa1EE4/YmJvUSqVG+zZ50wfohvWOe/fLJ/vgb0=";
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=";
azure-mgmt-servicelinker =
overrideAzureMgmtPackage super.azure-mgmt-servicelinker "1.2.0b2" "tar.gz"
"sha256-PpEFMM8ri9OgAa79dGhvPKy5YFfDZZustBUDieQrtZU=";
# ImportError: cannot import name 'Replica' from 'azure.mgmt.signalr.models'
azure-mgmt-signalr =
overrideAzureMgmtPackage super.azure-mgmt-signalr "2.0.0b1" "tar.gz"
"sha256-oK2ceBEoQ7gAeG6mye+x8HPzQU9bUNRPVJtRW2GL4xg=";
# ImportError: cannot import name 'AdvancedThreatProtectionName' from 'azure.mgmt.sql.models'
azure-mgmt-sql =
overrideAzureMgmtPackage super.azure-mgmt-sql "4.0.0b17" "tar.gz"
"sha256-i9VNbYJ3TgzURbtYYrXw+ez4ubK7BH39/EIL5kqb9Xg=";
# ValueError: The operation 'azure.mgmt.sqlvirtualmachine.operations#SqlVirtualMachinesOperations.begin_create_or_update' is invalid.
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.2.0" "tar.gz"
"sha256-KHyYQLAb6TGBnUA9p+1SvWL9B3sFKd1HDm28T+3ksg0=";
# ModuleNotFoundError: No module named 'azure.mgmt.synapse.operations._kusto_pool_attached_database_configurations_operations'
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=";
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=";
};
};
in

View File

@ -0,0 +1,42 @@
{
azure-cli,
azure-core,
buildPythonPackage,
fetchPypi,
isodate,
lib,
setuptools,
typing-extensions,
}:
buildPythonPackage rec {
pname = "azure-monitor-query";
version = "1.3.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-629Un2FJr0SExRq/m7tmEjn1eBRfi+9lSFWXbu9CL+Y=";
};
nativeBuildInputs = [ setuptools ];
dependencies = [
azure-core
isodate
typing-extensions
];
pythonImportsCheck = [
"azure"
"azure.monitor.query"
];
meta = {
changelog = "https://github.com/Azure/azure-sdk-for-python/blob/azure-monitor-query_${version}/sdk/monitor/azure-monitor-query/CHANGELOG.md";
description = "Microsoft Azure Monitor Query Client Library for Python";
homepage = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query";
license = lib.licenses.mit;
maintainers = azure-cli.meta.maintainers;
};
}

View File

@ -1302,6 +1302,8 @@ self: super: with self; {
azure-monitor-ingestion = callPackage ../development/python-modules/azure-monitor-ingestion { };
azure-monitor-query = callPackage ../development/python-modules/azure-monitor-query { };
azure-multiapi-storage = callPackage ../development/python-modules/azure-multiapi-storage { };
azure-nspkg = callPackage ../development/python-modules/azure-nspkg { };