Skip to content

Commit 42e00f4

Browse files
authored
Merge branch 'main' into auto-python-multi-namespace
2 parents f267d91 + 2cd051f commit 42e00f4

12 files changed

Lines changed: 96 additions & 83 deletions

File tree

eng/dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
azure-pylint-guidelines-checker==0.0.8
22
colorama==0.4.6
33
debugpy==1.8.9
4-
pytest==8.3.3
4+
pytest==8.3.4
55
tox==4.23.2
66
coverage==7.6.9
77
black==24.10.0

packages/autorest.python/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release
22

3+
## 6.27.2
4+
5+
### Bug Fixes
6+
7+
- [#2973](https://github.com/Azure/autorest.python/pull/2973) `:code:` in docstring should always be preceded by `\`
8+
9+
310
## 6.27.1
411

512
### Bump dependencies

packages/autorest.python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@autorest/python",
3-
"version": "6.27.1",
3+
"version": "6.27.2",
44
"description": "The Python extension for generators in AutoRest.",
55
"scripts": {
66
"start": "node ./scripts/run-python3.js ./scripts/start.py",
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
3131
"dependencies": {
32-
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDQxMjc0Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.4.3.tgz",
32+
"@typespec/http-client-python": "~0.4.4",
3333
"@autorest/system-requirements": "~1.0.2",
3434
"fs-extra": "~11.2.0",
3535
"tsx": "~4.19.1"

packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ async def put_mbcs(self, **kwargs: Any) -> None:
358358

359359
@distributed_trace_async
360360
async def get_whitespace(self, **kwargs: Any) -> str:
361-
"""Get string value with leading and trailing whitespace
362-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
363-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
361+
"""Get string value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
362+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
363+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
364364
365365
:return: str or the result of cls(response)
366366
:rtype: str
@@ -406,9 +406,9 @@ async def get_whitespace(self, **kwargs: Any) -> str:
406406

407407
@distributed_trace_async
408408
async def put_whitespace(self, **kwargs: Any) -> None:
409-
"""Set String value with leading and trailing whitespace
410-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
411-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
409+
"""Set String value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
410+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
411+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
412412
413413
:return: None or the result of cls(response)
414414
:rtype: None

packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur
556556

557557
@distributed_trace
558558
def get_whitespace(self, **kwargs: Any) -> str:
559-
"""Get string value with leading and trailing whitespace
560-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
561-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
559+
"""Get string value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
560+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
561+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
562562
563563
:return: str or the result of cls(response)
564564
:rtype: str
@@ -604,9 +604,9 @@ def get_whitespace(self, **kwargs: Any) -> str:
604604

605605
@distributed_trace
606606
def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
607-
"""Set String value with leading and trailing whitespace
608-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
609-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
607+
"""Set String value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
608+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
609+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
610610
611611
:return: None or the result of cls(response)
612612
:rtype: None

packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/aio/operations/_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ async def put_mbcs(self, **kwargs: Any) -> None:
367367

368368
@distributed_trace_async
369369
async def get_whitespace(self, **kwargs: Any) -> str:
370-
"""Get string value with leading and trailing whitespace
371-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
372-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
370+
"""Get string value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
371+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
372+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
373373
374374
:return: str
375375
:rtype: str
@@ -417,9 +417,9 @@ async def get_whitespace(self, **kwargs: Any) -> str:
417417

418418
@distributed_trace_async
419419
async def put_whitespace(self, **kwargs: Any) -> None:
420-
"""Set String value with leading and trailing whitespace
421-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
422-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
420+
"""Set String value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
421+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
422+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
423423
424424
:return: None
425425
:rtype: None

packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/operations/_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@ def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur
654654

655655
@distributed_trace
656656
def get_whitespace(self, **kwargs: Any) -> str:
657-
"""Get string value with leading and trailing whitespace
658-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
659-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
657+
"""Get string value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
658+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
659+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
660660
661661
:return: str
662662
:rtype: str
@@ -704,9 +704,9 @@ def get_whitespace(self, **kwargs: Any) -> str:
704704

705705
@distributed_trace
706706
def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
707-
"""Set String value with leading and trailing whitespace
708-
':code:`<tab>`:code:`<space>`:code:`<space>`Now is the time for all good men to come to the aid
709-
of their country:code:`<tab>`:code:`<space>`:code:`<space>`'.
707+
"""Set String value with leading and trailing whitespace '\\ :code:`<tab>`\\ :code:`<space>`\\
708+
:code:`<space>`Now is the time for all good men to come to the aid of their country\\
709+
:code:`<tab>`\\ :code:`<space>`\\ :code:`<space>`'.
710710
711711
:return: None
712712
:rtype: None

packages/typespec-python/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release
22

3+
## 0.37.2
4+
5+
### Bug Fixes
6+
7+
- [#2973](https://github.com/Azure/autorest.python/pull/2973) `:code:` in docstring should always be preceded by `\`
8+
9+
310
## 0.37.1
411

512
### Bump dependencies

packages/typespec-python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-python",
3-
"version": "0.37.1",
3+
"version": "0.37.2",
44
"author": "Microsoft Corporation",
55
"description": "TypeSpec emitter for Python SDKs",
66
"homepage": "https://github.com/Azure/autorest.python",
@@ -60,7 +60,7 @@
6060
"js-yaml": "~4.1.0",
6161
"semver": "~7.6.2",
6262
"tsx": "~4.19.1",
63-
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDQxMjc0Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.4.3.tgz",
63+
"@typespec/http-client-python": "~0.4.4",
6464
"fs-extra": "~11.2.0"
6565
},
6666
"devDependencies": {

packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/models/_models.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
class DifferentSpreadFloatRecord(_model_base.Model):
22-
"""The model spread Record:code:`<float32>` with the different known property type.
22+
"""The model spread Record\\ :code:`<float32>` with the different known property type.
2323
2424
2525
:ivar name: The id property. Required.
@@ -48,7 +48,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
4848

4949

5050
class DifferentSpreadFloatDerived(DifferentSpreadFloatRecord):
51-
"""The model extends from a model that spread Record:code:`<float32>` with the different known
51+
"""The model extends from a model that spread Record\\ :code:`<float32>` with the different known
5252
property type.
5353
5454
@@ -143,7 +143,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
143143

144144

145145
class DifferentSpreadModelRecord(_model_base.Model):
146-
"""The model spread Record:code:`<ModelForRecord>` with the different known property type.
146+
"""The model spread Record\\ :code:`<ModelForRecord>` with the different known property type.
147147
148148
149149
:ivar known_prop: Required.
@@ -172,7 +172,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
172172

173173

174174
class DifferentSpreadModelDerived(DifferentSpreadModelRecord):
175-
"""The model extends from a model that spread Record:code:`<ModelForRecord>` with the different
175+
"""The model extends from a model that spread Record\\ :code:`<ModelForRecord>` with the different
176176
known property type.
177177
178178
@@ -205,7 +205,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
205205

206206

207207
class DifferentSpreadStringRecord(_model_base.Model):
208-
"""The model spread Record:code:`<string>` with the different known property type.
208+
"""The model spread Record\\ :code:`<string>` with the different known property type.
209209
210210
211211
:ivar id: The name property. Required.
@@ -234,7 +234,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
234234

235235

236236
class DifferentSpreadStringDerived(DifferentSpreadStringRecord):
237-
"""The model extends from a model that spread Record:code:`<string>` with the different known
237+
"""The model extends from a model that spread Record\\ :code:`<string>` with the different known
238238
property type.
239239
240240
@@ -267,7 +267,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
267267

268268

269269
class ExtendsFloatAdditionalProperties(_model_base.Model):
270-
"""The model extends from Record:code:`<float32>` type.
270+
"""The model extends from Record\\ :code:`<float32>` type.
271271
272272
273273
:ivar id: The id property. Required.
@@ -296,7 +296,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
296296

297297

298298
class ExtendsModelAdditionalProperties(_model_base.Model):
299-
"""The model extends from Record:code:`<ModelForRecord>` type.
299+
"""The model extends from Record\\ :code:`<ModelForRecord>` type.
300300
301301
302302
:ivar known_prop: Required.
@@ -354,7 +354,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
354354

355355

356356
class ExtendsStringAdditionalProperties(_model_base.Model):
357-
"""The model extends from Record:code:`<string>` type.
357+
"""The model extends from Record\\ :code:`<string>` type.
358358
359359
360360
:ivar name: The name property. Required.
@@ -383,7 +383,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
383383

384384

385385
class ExtendsUnknownAdditionalProperties(_model_base.Model):
386-
"""The model extends from Record:code:`<unknown>` type.
386+
"""The model extends from Record\\ :code:`<unknown>` type.
387387
388388
389389
:ivar name: The name property. Required.
@@ -412,7 +412,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
412412

413413

414414
class ExtendsUnknownAdditionalPropertiesDerived(ExtendsUnknownAdditionalProperties): # pylint: disable=name-too-long
415-
"""The model extends from a type that extends from Record:code:`<unknown>`.
415+
"""The model extends from a type that extends from Record\\ :code:`<unknown>`.
416416
417417
418418
:ivar name: The name property. Required.
@@ -449,7 +449,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
449449

450450

451451
class ExtendsUnknownAdditionalPropertiesDiscriminated(_model_base.Model): # pylint: disable=name-too-long
452-
"""The model extends from Record:code:`<unknown>` with a discriminator.
452+
"""The model extends from Record\\ :code:`<unknown>` with a discriminator.
453453
454454
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
455455
ExtendsUnknownAdditionalPropertiesDiscriminatedDerived
@@ -530,7 +530,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
530530

531531

532532
class IsFloatAdditionalProperties(_model_base.Model):
533-
"""The model is from Record:code:`<float32>` type.
533+
"""The model is from Record\\ :code:`<float32>` type.
534534
535535
536536
:ivar id: The id property. Required.
@@ -559,7 +559,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
559559

560560

561561
class IsModelAdditionalProperties(_model_base.Model):
562-
"""The model is from Record:code:`<ModelForRecord>` type.
562+
"""The model is from Record\\ :code:`<ModelForRecord>` type.
563563
564564
565565
:ivar known_prop: Required.
@@ -617,7 +617,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
617617

618618

619619
class IsStringAdditionalProperties(_model_base.Model):
620-
"""The model is from Record:code:`<string>` type.
620+
"""The model is from Record\\ :code:`<string>` type.
621621
622622
623623
:ivar name: The name property. Required.
@@ -646,7 +646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
646646

647647

648648
class IsUnknownAdditionalProperties(_model_base.Model):
649-
"""The model is from Record:code:`<unknown>` type.
649+
"""The model is from Record\\ :code:`<unknown>` type.
650650
651651
652652
:ivar name: The name property. Required.
@@ -675,7 +675,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
675675

676676

677677
class IsUnknownAdditionalPropertiesDerived(IsUnknownAdditionalProperties):
678-
"""The model extends from a type that is Record:code:`<unknown>` type.
678+
"""The model extends from a type that is Record\\ :code:`<unknown>` type.
679679
680680
681681
:ivar name: The name property. Required.
@@ -712,7 +712,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
712712

713713

714714
class IsUnknownAdditionalPropertiesDiscriminated(_model_base.Model): # pylint: disable=name-too-long
715-
"""The model is Record:code:`<unknown>` with a discriminator.
715+
"""The model is Record\\ :code:`<unknown>` with a discriminator.
716716
717717
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
718718
IsUnknownAdditionalPropertiesDiscriminatedDerived
@@ -822,7 +822,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
822822

823823

824824
class MultipleSpreadRecord(_model_base.Model):
825-
"""The model spread Record:code:`<string>` and Record:code:`<float32>`.
825+
"""The model spread Record\\ :code:`<string>` and Record\\ :code:`<float32>`.
826826
827827
828828
:ivar flag: The name property. Required.
@@ -851,7 +851,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
851851

852852

853853
class SpreadFloatRecord(_model_base.Model):
854-
"""The model spread Record:code:`<float32>` with the same known property type.
854+
"""The model spread Record\\ :code:`<float32>` with the same known property type.
855855
856856
857857
:ivar id: The id property. Required.
@@ -909,7 +909,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
909909

910910

911911
class SpreadModelRecord(_model_base.Model):
912-
"""The model spread Record:code:`<ModelForRecord>` with the same known property type.
912+
"""The model spread Record\\ :code:`<ModelForRecord>` with the same known property type.
913913
914914
915915
:ivar known_prop: Required.
@@ -938,7 +938,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
938938

939939

940940
class SpreadRecordForDiscriminatedUnion(_model_base.Model):
941-
"""The model spread Record:code:`<WidgetData>`.
941+
"""The model spread Record\\ :code:`<WidgetData>`.
942942
943943
944944
:ivar name: The name property. Required.
@@ -1083,7 +1083,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
10831083

10841084

10851085
class SpreadStringRecord(_model_base.Model):
1086-
"""The model spread Record:code:`<string>` with the same known property type.
1086+
"""The model spread Record\\ :code:`<string>` with the same known property type.
10871087
10881088
10891089
:ivar name: The name property. Required.

0 commit comments

Comments
 (0)