Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_scripts/windows/scripts/patch_models_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def find_models_to_change(module_name):
return [
importlib.import_module('.'+label+'.models', main_module.__name__)
for (_, label, ispkg) in pkgutil.iter_modules(main_module.__path__)
if ispkg and label != 'aio'
if ispkg and label != 'aio' and label != '_utils'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiasli Could you help review the build_scripts related code?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L246~L247 indicates this function processes all models module under API-specific folders, such as <main_module>.v2015_04_01.models.

importlib.import_module('.'+label+'.models', main_module.__name__)
for (_, label, ispkg) in pkgutil.iter_modules(main_module.__path__)

_utils doesn't have models at all:

https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_utils

So, it is reasonable to exclude _utils here. However, this solution is very fragile as it depends on _utils's structure.

Currently, _utils exists in both the root folder of the mgmt SDK and also API-specific folders:

image

breaking of fact that each API-specific folder is separated and self-containing. serialization.py files in different _utils also contain duplicated code. SDK team should confirm if this is a bug in autorest and remove the duplication.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msyyc Could you please help take a look at this SDK issue?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can validate xxx.xxx.models pkg exists before we import it in our build script.

Made a pr for dealing with it: #31470

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhoxing-ms / @jiasli, Yeah, _utils are duplicated in multiapi package just like _vendor.py in old structure. Since we plan to gradually drop multiapi package started from May as planned before with @kairu-ms, azure cli could drop the build script which is for multiapi in short future.

]


Expand Down
1 change: 1 addition & 0 deletions src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def default_api_version(self):
'VERSION_2023_11_01_PREVIEW': "2023-11-01-preview",
'VERSION_2024_11_01_PREVIEW': "2024-11-01-preview",
'VERSION_2025_03_01_PREVIEW': "2025-03-01-preview",
'VERSION_2025_04_01': "2025-04-01"
},
ResourceType.MGMT_CONTAINERSERVICE: {
# src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_custom.py:50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
VERSION_2023_01_01_PREVIEW = "2023-01-01-preview"
VERSION_2024_11_01_PREVIEW = "2024-11-01-preview"
VERSION_2025_03_01_PREVIEW = "2025-03-01-preview"
VERSION_2025_04_01 = "2025-04-01"


def get_acr_service_client(cli_ctx, api_version=None):
Expand Down Expand Up @@ -83,4 +84,4 @@ def cf_acr_agentpool(cli_ctx, *_):


def cf_acr_connected_registries(cli_ctx, *_):
return get_acr_service_client(cli_ctx, VERSION_2024_11_01_PREVIEW).connected_registries
return get_acr_service_client(cli_ctx, VERSION_2025_04_01).connected_registries

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ azure-mgmt-cdn==12.0.0
azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==13.0.0
azure-mgmt-containerregistry==14.0.0
azure-mgmt-containerservice==35.0.0
azure-mgmt-core==1.5.0
azure-mgmt-cosmosdb==9.7.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ azure-mgmt-cdn==12.0.0
azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==13.0.0
azure-mgmt-containerregistry==14.0.0
azure-mgmt-containerservice==35.0.0
azure-mgmt-core==1.5.0
azure-mgmt-cosmosdb==9.7.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ azure-mgmt-cdn==12.0.0
azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==34.1.0
azure-mgmt-containerinstance==10.2.0b1
azure-mgmt-containerregistry==13.0.0
azure-mgmt-containerregistry==14.0.0
azure-mgmt-containerservice==35.0.0
azure-mgmt-core==1.5.0
azure-mgmt-cosmosdb==9.7.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
'azure-mgmt-cognitiveservices~=13.5.0',
'azure-mgmt-compute~=34.1.0',
'azure-mgmt-containerinstance==10.2.0b1',
'azure-mgmt-containerregistry==13.0.0',
'azure-mgmt-containerregistry==14.0.0',
'azure-mgmt-containerservice~=35.0.0',
'azure-mgmt-cosmosdb==9.7.0',
'azure-mgmt-databoxedge~=1.0.0',
Expand Down