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
8 changes: 8 additions & 0 deletions packages/autorest.python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release

## 6.37.2

### Bug Fixes

- [#3154](https://github.com/Azure/autorest.python/pull/3154) fix outputfolder of packaging files for arm sdk
- [#3154](https://github.com/Azure/autorest.python/pull/3154) Ensure necessary typing imports for internal models


## 6.37.1

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/python",
"version": "6.37.1",
"version": "6.37.2",
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"start": "node ./scripts/run-python3.js ./scripts/start.py",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "~0.14.1",
"@typespec/http-client-python": "~0.14.2",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace: azure.mgmt.test
package-version: 1.0.0b1
clear-output-folder: true
version-tolerant: false
package-mode: azure-mgmt
```

``` yaml $(python)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 1.0.0b1 (1970-01-01)

- Initial version
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include *.md
include LICENSE
include azure/mgmt/test/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Azure Mgmt Test client library for Python
<!-- write necessary description of service -->

## Getting started

### Install the package

```bash
python -m pip install azure-mgmt-test
```

#### Prequisites

- Python 3.9 or later is required to use this package.
- You need an [Azure subscription][azure_sub] to use this package.
- An existing Azure Mgmt Test instance.

#### Create with an Azure Active Directory Credential
To use an [Azure Active Directory (AAD) token credential][authenticate_with_token],
provide an instance of the desired credential type obtained from the
[azure-identity][azure_identity_credentials] library.

To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip]

After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use.
As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client:

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`

Use the returned token credential to authenticate the client:

```python
>>> from azure.mgmt.test import AutoRestSwaggerBATArrayService
>>> from azure.identity import DefaultAzureCredential
>>> client = AutoRestSwaggerBATArrayService(endpoint='<endpoint>', credential=DefaultAzureCredential())
```

## Examples

```python
>>> from azure.mgmt.test import AutoRestSwaggerBATArrayService
>>> from azure.identity import DefaultAzureCredential
>>> from azure.core.exceptions import HttpResponseError

>>> client = AutoRestSwaggerBATArrayService(endpoint='<endpoint>', credential=DefaultAzureCredential())
>>> try:
<!-- write test code here -->
except HttpResponseError as e:
print('service responds error: {}'.format(e.response.json()))

```

## Contributing

This project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.

This project has adopted the
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
see the Code of Conduct FAQ or contact opencode@microsoft.com with any
additional questions or comments.

<!-- LINKS -->
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
[azure_identity_pip]: https://pypi.org/project/azure-identity/
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[pip]: https://pypi.org/project/pip/
[azure_sub]: https://azure.microsoft.com/free/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-e ../../../tools/azure-sdk-tools
../../core/azure-core
../../identity/azure-identity
../../core/azure-mgmt-core
aiohttp
Original file line number Diff line number Diff line change
@@ -1,59 +1,52 @@
#!/usr/bin/env python

# -------------------------------------------------------------------------
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------


import os
import re
import os.path
from io import open
from setuptools import find_packages, setup
from setuptools import setup, find_packages


# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-mgmt-test"
PACKAGE_PPRINT_NAME = "Test Management"
PACKAGE_PPRINT_NAME = "Azure Mgmt Test"

# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace("-", "/")
# a-b-c => a.b.c
namespace_name = PACKAGE_NAME.replace("-", ".")

# Version extraction inspired from 'requests'
with open(
(
os.path.join(package_folder_path, "version.py")
if os.path.exists(os.path.join(package_folder_path, "version.py"))
else os.path.join(package_folder_path, "_version.py")
),
"r",
) as fd:
with open(os.path.join(package_folder_path, "_version.py"), "r") as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)

if not version:
raise RuntimeError("Cannot find version information")


setup(
name=PACKAGE_NAME,
version=version,
description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME),
description="Microsoft Corporation {} Client Library for Python".format(PACKAGE_PPRINT_NAME),
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
license="MIT License",
author="Microsoft Corporation",
author_email="azpysdkhelp@microsoft.com",
url="https://github.com/Azure/azure-sdk-for-python",
keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product
url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk",
keywords="azure, azure sdk",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
],
zip_safe=False,
Expand All @@ -66,11 +59,13 @@
]
),
include_package_data=True,
package_data={
"azure.mgmt.test": ["py.typed"],
},
install_requires=[
"isodate>=0.6.1",
"msrest>=0.7.1",
"azure-mgmt-core>=1.6.0",
"typing-extensions>=4.6.0",
"azure-common>=1.1",
"azure-mgmt-core>=1.3.2",
],
python_requires=">=3.8",
python_requires=">=3.9",
)
28 changes: 28 additions & 0 deletions packages/autorest.python/test/unittests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,31 @@ def test_azure_test_import():
from azure.test._generated import operations

from azure.test import CustomizeClient


def test_package_mode_for_azure_mgmt_test():
# check whether samples/specification/azure-mgmt-test/test/azure-mgmt-test contains setup.py/CHANGELOG.md
import os
from pathlib import Path

# Get the path to the samples directory relative to this test file
current_dir = Path(__file__).parent
samples_dir = (
current_dir.parent.parent / "samples" / "specification" / "azure-mgmt-test" / "test" / "azure-mgmt-test"
)

# Check if setup.py exists
setup_py_path = samples_dir / "setup.py"
assert setup_py_path.exists(), f"setup.py not found at {setup_py_path}"

# Check if CHANGELOG.md exists
changelog_path = samples_dir / "CHANGELOG.md"
assert changelog_path.exists(), f"CHANGELOG.md not found at {changelog_path}"

# setup.py shall not exist in inner folder
inner_setup_py_path = samples_dir / "azure/mgmt/test/setup.py"
assert not inner_setup_py_path.exists(), f"setup.py should not exist at {inner_setup_py_path}"

# CHANGELOG.md shall not exist in inner folder
inner_changelog_path = samples_dir / "azure/mgmt/test/CHANGELOG.md"
assert not inner_changelog_path.exists(), f"CHANGELOG.md should not exist at {inner_changelog_path}"
8 changes: 8 additions & 0 deletions packages/typespec-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release

## 0.47.2

### Bug Fixes

- [#3154](https://github.com/Azure/autorest.python/pull/3154) fix outputfolder of packaging files for arm sdk
- [#3154](https://github.com/Azure/autorest.python/pull/3154) Ensure necessary typing imports for internal models


## 0.47.1

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/typespec-python",
"version": "0.47.1",
"version": "0.47.2",
"author": "Microsoft Corporation",
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://github.com/Azure/autorest.python",
Expand Down Expand Up @@ -67,7 +67,7 @@
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "~0.14.1",
"@typespec/http-client-python": "~0.14.2",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading