Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump autorest core version #880

Merged
merged 2 commits into from
Feb 10, 2021
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
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

### 2021-02-10 - 5.6.3

min Autorest core version: 3.0.6372

min Modelerfour version: 4.15.456

**Bug Fixes**
- Bump `Autorest core` minimum version to [correctly deal with](https://github.com/Azure/autorest/pull/3860) overriding configs. Fixes submodule-specific code in our multiapi client #880

### 2021-02-04 - 5.6.2

Autorest core version: 3.0.6318
Expand Down
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See [here](https://github.com/Azure/autorest.python/wiki/Generating-with-autores

# Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
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.

Expand All @@ -16,19 +16,18 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.


### Autorest plugin configuration
- Please don't edit this section unless you're re-configuring how the powershell extension plugs in to AutoRest
AutoRest needs the below config to pick this up as a plug-in - see https://github.com/Azure/autorest/blob/master/docs/developer/architecture/AutoRest-extension.md

- Please don't edit this section unless you're re-configuring how the powershell extension plugs in to AutoRest
AutoRest needs the below config to pick this up as a plug-in - see https://github.com/Azure/autorest/blob/master/docs/developer/architecture/AutoRest-extension.md

#### Python code gen

``` yaml !$(multiapiscript)
```yaml !$(multiapiscript)
pass-thru:
- model-deduplicator
- subset-reducer
version: ^3.0.6318
version: ^3.0.6372
use-extension:
"@autorest/modelerfour": ^4.15.456

Expand All @@ -43,12 +42,12 @@ modelerfour:
parameter: snakecase
property: snakecase
operation: snakecase
operationGroup: pascalcase
choice: pascalcase
choiceValue: uppercase
constant: snakecase
constantParameter: snakecase
type: pascalcase
operationGroup: pascalcase
choice: pascalcase
choiceValue: uppercase
constant: snakecase
constantParameter: snakecase
type: pascalcase
local: _ + snakecase
global: snakecase
preserve-uppercase-max-length: 6
Expand All @@ -57,7 +56,6 @@ modelerfour:
base64: base64
IncludeAPIs: include_apis


pipeline:
python:
# doesn't process anything, just makes it so that the 'python:' config section loads early.
Expand Down Expand Up @@ -85,16 +83,15 @@ pipeline:
scope: scope-codegen/emitter

scope-codegen/emitter:
input-artifact: python-files
output-uri-expr: $key
input-artifact: python-files
output-uri-expr: $key

output-artifact: python-files
```

# Multiapi script pipeline

``` yaml $(multiapiscript)

```yaml $(multiapiscript)
pipeline:
python/multiapiscript:
scope: multiapiscript
Expand All @@ -105,16 +102,15 @@ pipeline:
scope: scope-multiapiscript/emitter

scope-multiapiscript/emitter:
input-artifact: python-files
output-uri-expr: $key
input-artifact: python-files
output-uri-expr: $key

output-artifact: python-files
```

# Black script pipeline

``` yaml $(black)

```yaml $(black)
pipeline:
python/black:
scope: black
Expand All @@ -126,12 +122,13 @@ pipeline:
scope: scope-black/emitter

scope-black/emitter:
input-artifact: python-files
output-uri-expr: $key
input-artifact: python-files
output-uri-expr: $key

output-artifact: python-files
```

<!-- LINKS -->

[python_docs]: https://github.com/Azure/autorest.python/tree/autorestv3/docs/readme.md
[main_docs]: https://github.com/Azure/autorest/tree/master/docs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def namespace_models():

@pytest.mark.parametrize('api_version', ["2.0.0"])
def test_specify_api_version_multiapi_client(client):
assert client.profile.label == "multiapiwithsubmodule.MultiapiServiceClient 2.0.0"
assert client.profile.label == "multiapiwithsubmodule.submodule.MultiapiServiceClient 2.0.0"

def test_configuration_kwargs(default_client):
# making sure that the package name is correct in the sdk moniker
Expand Down
2 changes: 1 addition & 1 deletion test/multiapi/AcceptanceTests/test_multiapi_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def namespace_models():

@pytest.mark.parametrize('api_version', ["2.0.0"])
def test_specify_api_version_multiapi_client(client):
assert client.profile.label == "multiapiwithsubmodule.MultiapiServiceClient 2.0.0"
assert client.profile.label == "multiapiwithsubmodule.submodule.MultiapiServiceClient 2.0.0"

def test_configuration_kwargs(default_client):
# making sure that the package name is correct in the sdk moniker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MultiapiServiceClient(MultiapiServiceClientOperationsMixin, MultiApiClient
"""

DEFAULT_API_VERSION = '3.0.0'
_PROFILE_TAG = "multiapiwithsubmodule.MultiapiServiceClient"
_PROFILE_TAG = "multiapiwithsubmodule.submodule.MultiapiServiceClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -91,9 +91,9 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 1.0.0: :mod:`v1.models<multiapiwithsubmodule.v1.models>`
* 2.0.0: :mod:`v2.models<multiapiwithsubmodule.v2.models>`
* 3.0.0: :mod:`v3.models<multiapiwithsubmodule.v3.models>`
* 1.0.0: :mod:`v1.models<multiapiwithsubmodule.submodule.v1.models>`
* 2.0.0: :mod:`v2.models<multiapiwithsubmodule.submodule.v2.models>`
* 3.0.0: :mod:`v3.models<multiapiwithsubmodule.submodule.v3.models>`
"""
if api_version == '1.0.0':
from .v1 import models
Expand All @@ -110,9 +110,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
def operation_group_one(self):
"""Instance depends on the API version:

* 1.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v1.operations.OperationGroupOneOperations>`
* 2.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v2.operations.OperationGroupOneOperations>`
* 3.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v3.operations.OperationGroupOneOperations>`
* 1.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v1.operations.OperationGroupOneOperations>`
* 2.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v2.operations.OperationGroupOneOperations>`
* 3.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v3.operations.OperationGroupOneOperations>`
"""
api_version = self._get_api_version('operation_group_one')
if api_version == '1.0.0':
Expand All @@ -129,8 +129,8 @@ def operation_group_one(self):
def operation_group_two(self):
"""Instance depends on the API version:

* 2.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.v2.operations.OperationGroupTwoOperations>`
* 3.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.v3.operations.OperationGroupTwoOperations>`
* 2.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.submodule.v2.operations.OperationGroupTwoOperations>`
* 3.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.submodule.v3.operations.OperationGroupTwoOperations>`
"""
api_version = self._get_api_version('operation_group_two')
if api_version == '2.0.0':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MultiapiServiceClient(MultiapiServiceClientOperationsMixin, MultiApiClient
"""

DEFAULT_API_VERSION = '3.0.0'
_PROFILE_TAG = "multiapiwithsubmodule.MultiapiServiceClient"
_PROFILE_TAG = "multiapiwithsubmodule.submodule.MultiapiServiceClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -89,9 +89,9 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 1.0.0: :mod:`v1.models<multiapiwithsubmodule.v1.models>`
* 2.0.0: :mod:`v2.models<multiapiwithsubmodule.v2.models>`
* 3.0.0: :mod:`v3.models<multiapiwithsubmodule.v3.models>`
* 1.0.0: :mod:`v1.models<multiapiwithsubmodule.submodule.v1.models>`
* 2.0.0: :mod:`v2.models<multiapiwithsubmodule.submodule.v2.models>`
* 3.0.0: :mod:`v3.models<multiapiwithsubmodule.submodule.v3.models>`
"""
if api_version == '1.0.0':
from ..v1 import models
Expand All @@ -108,9 +108,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
def operation_group_one(self):
"""Instance depends on the API version:

* 1.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v1.aio.operations.OperationGroupOneOperations>`
* 2.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v2.aio.operations.OperationGroupOneOperations>`
* 3.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.v3.aio.operations.OperationGroupOneOperations>`
* 1.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v1.aio.operations.OperationGroupOneOperations>`
* 2.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v2.aio.operations.OperationGroupOneOperations>`
* 3.0.0: :class:`OperationGroupOneOperations<multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupOneOperations>`
"""
api_version = self._get_api_version('operation_group_one')
if api_version == '1.0.0':
Expand All @@ -127,8 +127,8 @@ def operation_group_one(self):
def operation_group_two(self):
"""Instance depends on the API version:

* 2.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.v2.aio.operations.OperationGroupTwoOperations>`
* 3.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.v3.aio.operations.OperationGroupTwoOperations>`
* 2.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.submodule.v2.aio.operations.OperationGroupTwoOperations>`
* 3.0.0: :class:`OperationGroupTwoOperations<multiapiwithsubmodule.submodule.v3.aio.operations.OperationGroupTwoOperations>`
"""
api_version = self._get_api_version('operation_group_two')
if api_version == '2.0.0':
Expand Down