Skip to content
Draft
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
43 changes: 27 additions & 16 deletions eng/tools/azure-sdk-tools/azpysdk/apistub.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from ci_tools.parsing import ParsedSetup

REPO_ROOT = discover_repo_root()
AZURE_SDK_INDEX_URL = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
PYPI_INDEX_URL = "https://pypi.org/simple/"


def get_package_wheel_path(pkg_root: str) -> str:
Expand Down Expand Up @@ -103,22 +105,31 @@ def ensure_apistub_dependencies(self, executable: str, package_dir: str, staging

def download_pypi_wheel(self, executable: str, package_name: str, version: str, staging_directory: str) -> str:
"""Download a released wheel from PyPI into the staging directory and return its path."""
logger.info(f"Downloading {package_name}=={version} from PyPI.")
self.run_venv_command(
executable,
[
"-m",
"pip",
"download",
f"{package_name}=={version}",
"--no-deps",
"--only-binary=:all:",
"-d",
staging_directory,
],
cwd=staging_directory,
check=True,
)
for index_url in (AZURE_SDK_INDEX_URL, PYPI_INDEX_URL):
logger.info(f"Downloading {package_name}=={version} from {index_url}.")
try:
self.run_venv_command(
executable,
[
"-m",
"pip",
"download",
f"{package_name}=={version}",
"--no-deps",
"--only-binary=:all:",
f"--index-url={index_url}",
"-d",
staging_directory,
],
cwd=staging_directory,
check=True,
)
break
except CalledProcessError as error:
if index_url == PYPI_INDEX_URL:
logger.error(f"Failed to download {package_name}=={version} from both package indexes.")
raise
logger.warning(f"Failed to download from the Azure SDK feed: {error}. Retrying from public PyPI.")
found_whl = find_whl(staging_directory, package_name, version)
if not found_whl:
raise FileNotFoundError(
Expand Down
30 changes: 30 additions & 0 deletions eng/tools/azure-sdk-tools/tests/test_apistub.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,38 @@ def test_download_pypi_wheel_runs_pip_download(self, _find_whl, tmp_path):
cmds = run_venv_command.call_args.args[1]
assert cmds[0:4] == ["-m", "pip", "download", "azure-core==1.0.0"]
assert "--no-deps" in cmds
assert (
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
in cmds
)
assert result == os.path.join(staging, "azure_core-1.0.0-py3-none-any.whl")

@patch("azpysdk.apistub.find_whl", return_value="azure_core-1.0.0-py3-none-any.whl")
def test_download_pypi_wheel_falls_back_to_public_pypi(self, _find_whl, tmp_path):
"""download_pypi_wheel should retry public PyPI when the Azure SDK feed fails."""
stub = apistub()

with patch.object(stub, "run_venv_command", side_effect=[CalledProcessError(1, "pip"), None]) as run:
result = stub.download_pypi_wheel(sys.executable, "azure-core", "1.0.0", str(tmp_path))

assert run.call_count == 2
assert "--index-url=https://pypi.org/simple/" in run.call_args_list[1].args[1]
assert result == os.path.join(str(tmp_path), "azure_core-1.0.0-py3-none-any.whl")

def test_download_pypi_wheel_reports_both_index_failures(self, tmp_path):
"""download_pypi_wheel should propagate the public PyPI failure after both indexes fail."""
stub = apistub()
public_pypi_error = CalledProcessError(2, "pip")

with patch.object(
stub, "run_venv_command", side_effect=[CalledProcessError(1, "pip"), public_pypi_error]
) as run:
with pytest.raises(CalledProcessError) as exc_info:
stub.download_pypi_wheel(sys.executable, "azure-core", "1.0.0", str(tmp_path))

assert run.call_count == 2
assert exc_info.value is public_pypi_error

@patch("azpysdk.apistub.find_whl", return_value=None)
def test_download_pypi_wheel_raises_when_no_wheel(self, _find_whl, tmp_path):
"""download_pypi_wheel should raise FileNotFoundError when no wheel is downloaded."""
Expand Down
39 changes: 39 additions & 0 deletions sdk/scvmm/azure-mgmt-scvmm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Release History

## 2.0.0 (2026-08-13)

### Features Added

- Client `ScVmmMgmtClient` added parameter `cloud_setting` in method `__init__`
- Client `ScVmmMgmtClient` added method `send_request`
- Model `CloudCapacity` added property `storage_gb`
- Model `GuestAgentProperties` added property `private_link_scope_resource_id`
- Model `OsProfileForVmInstance` added property `admin_username`
- Model `OsProfileForVmInstance` added property `domain_name`
- Model `OsProfileForVmInstance` added property `domain_password`
- Model `OsProfileForVmInstance` added property `domain_username`
- Model `OsProfileForVmInstance` added property `product_key`
- Model `OsProfileForVmInstance` added property `run_once_commands`
- Model `OsProfileForVmInstance` added property `timezone`
- Model `OsProfileForVmInstance` added property `workgroup`
- Model `VirtualMachineInventoryItem` added property `generation`
- Added model `ExtensionResource`

### Breaking Changes

- Deleted or renamed model `AvailabilitySetListResult`
- Deleted or renamed model `CloudListResult`
- Deleted or renamed model `GuestAgentListResult`
- Deleted or renamed model `InventoryItemListResult`
- Deleted or renamed model `OperationListResult`
- Deleted or renamed model `VirtualMachineInstanceListResult`
- Deleted or renamed model `VirtualMachineTemplateListResult`
- Deleted or renamed model `VirtualNetworkListResult`
- Deleted or renamed model `VmInstanceHybridIdentityMetadataListResult`
- Deleted or renamed model `VmmServerListResult`
- Method `AvailabilitySetsOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`
- Method `CloudsOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`
- Method `VirtualMachineInstancesOperations.begin_delete` changed its parameter `delete_from_host` from `positional_or_keyword` to `keyword_only`
- Method `VirtualMachineInstancesOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`
- Method `VirtualMachineTemplatesOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`
- Method `VirtualNetworksOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`
- Method `VmmServersOperations.begin_delete` changed its parameter `force` from `positional_or_keyword` to `keyword_only`

## 1.0.0 (2024-06-20)

### Features Added
Expand Down
9 changes: 4 additions & 5 deletions sdk/scvmm/azure-mgmt-scvmm/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
include _meta.json
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/scvmm/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/mgmt/__init__.py
10 changes: 5 additions & 5 deletions sdk/scvmm/azure-mgmt-scvmm/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Scvmm Management Client Library.
This package has been tested with Python 3.8+.
This package has been tested with Python 3.10+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand All @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For

### Prerequisites

- Python 3.8+ is required to use this package.
- Python 3.10+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package
Expand All @@ -24,7 +24,7 @@ pip install azure-identity

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand All @@ -36,11 +36,11 @@ With above configuration, client can be authenticated by following code:

```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.scvmm import SCVMM
from azure.mgmt.scvmm import ScVmmMgmtClient
import os

sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = SCVMM(credential=DefaultAzureCredential(), subscription_id=sub_id)
client = ScVmmMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
```

## Examples
Expand Down
11 changes: 0 additions & 11 deletions sdk/scvmm/azure-mgmt-scvmm/_meta.json

This file was deleted.

11 changes: 11 additions & 0 deletions sdk/scvmm/azure-mgmt-scvmm/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"apiVersion": "2025-03-13",
"apiVersions": {
"Microsoft.ScVmm": "2025-03-13"
},
"commit": "aedbe3cd3521b92b9e15de1a532d5e4d81eddf90",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/scvmm/ScVmm.Management",
"emitterVersion": "0.63.3",
"httpClientPythonVersion": "^0.35.1"
}
Loading
Loading