@typespec/http-client-python 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/emitter/emitter.js +1 -3
  2. package/dist/emitter/emitter.js.map +1 -1
  3. package/dist/emitter/lib.d.ts +1 -0
  4. package/dist/emitter/lib.d.ts.map +1 -1
  5. package/dist/emitter/lib.js +10 -0
  6. package/dist/emitter/lib.js.map +1 -1
  7. package/emitter/src/emitter.ts +1 -3
  8. package/emitter/src/lib.ts +13 -0
  9. package/emitter/temp/tsconfig.tsbuildinfo +1 -1
  10. package/eng/scripts/ci/regenerate.ts +11 -4
  11. package/eng/scripts/setup/__pycache__/package_manager.cpython-39.pyc +0 -0
  12. package/eng/scripts/setup/__pycache__/venvtools.cpython-39.pyc +0 -0
  13. package/generator/build/lib/pygen/__init__.py +29 -2
  14. package/generator/build/lib/pygen/codegen/models/code_model.py +32 -0
  15. package/generator/build/lib/pygen/codegen/models/enum_type.py +4 -1
  16. package/generator/build/lib/pygen/codegen/models/model_type.py +4 -1
  17. package/generator/build/lib/pygen/codegen/models/operation.py +3 -4
  18. package/generator/build/lib/pygen/codegen/models/paging_operation.py +1 -1
  19. package/generator/build/lib/pygen/codegen/serializers/__init__.py +85 -74
  20. package/generator/build/lib/pygen/codegen/serializers/builder_serializer.py +4 -3
  21. package/generator/build/lib/pygen/codegen/serializers/general_serializer.py +86 -13
  22. package/generator/build/lib/pygen/codegen/templates/packaging_templates/pyproject.toml.jinja2 +109 -0
  23. package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
  24. package/generator/pygen/__init__.py +29 -2
  25. package/generator/pygen/codegen/models/code_model.py +32 -0
  26. package/generator/pygen/codegen/models/enum_type.py +4 -1
  27. package/generator/pygen/codegen/models/model_type.py +4 -1
  28. package/generator/pygen/codegen/models/operation.py +3 -4
  29. package/generator/pygen/codegen/models/paging_operation.py +1 -1
  30. package/generator/pygen/codegen/serializers/__init__.py +85 -74
  31. package/generator/pygen/codegen/serializers/builder_serializer.py +4 -3
  32. package/generator/pygen/codegen/serializers/general_serializer.py +86 -13
  33. package/generator/pygen/codegen/templates/packaging_templates/pyproject.toml.jinja2 +109 -0
  34. package/generator/pygen.egg-info/SOURCES.txt +1 -0
  35. package/generator/test/azure/requirements.txt +1 -0
  36. package/generator/test/azure/tox.ini +2 -2
  37. package/generator/test/generic_mock_api_tests/asynctests/test_authentication_async.py +7 -4
  38. package/generator/test/generic_mock_api_tests/test_authentication.py +7 -4
  39. package/generator/test/unbranded/mock_api_tests/test_unbranded.py +3 -1
  40. package/generator/test/unbranded/requirements.txt +1 -0
  41. package/generator/test/unbranded/tox.ini +2 -2
  42. package/package.json +1 -1
@@ -20,7 +20,7 @@ commands =
20
20
  python ../../../eng/scripts/ci/run_pyright.py -t azure -s "generated" {posargs}
21
21
 
22
22
  # apiview
23
- pip install apiview-stub-generator==0.3.13 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
23
+ pip install apiview-stub-generator==0.3.19 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
24
24
  python ../../../eng/scripts/ci/run_apiview.py -t azure -s "generated" {posargs}
25
25
 
26
26
  [testenv:test]
@@ -52,5 +52,5 @@ commands =
52
52
  deps=
53
53
  -r requirements.txt
54
54
  commands =
55
- pip install apiview-stub-generator==0.3.13 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
55
+ pip install apiview-stub-generator==0.3.19 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
56
56
  python ../../../eng/scripts/ci/run_apiview.py -t azure -s "generated" {posargs}
@@ -8,6 +8,7 @@ from authentication.apikey.aio import ApiKeyClient
8
8
  from authentication.http.custom.aio import CustomClient
9
9
  from authentication.oauth2.aio import OAuth2Client
10
10
  from authentication.union.aio import UnionClient
11
+ from setuppy.authentication.union.aio import UnionClient as SetuppyUnionClient
11
12
 
12
13
 
13
14
  # Utilities functions
@@ -99,14 +100,16 @@ async def test_oauth2_invalid(oauth2_client, core_library):
99
100
 
100
101
 
101
102
  @pytest.mark.asyncio
102
- async def test_union_keyvalid(api_key_client):
103
- client = api_key_client(UnionClient)
103
+ @pytest.mark.parametrize("union_client_type", [UnionClient, SetuppyUnionClient])
104
+ async def test_union_keyvalid(api_key_client, union_client_type):
105
+ client = api_key_client(union_client_type)
104
106
  await client.valid_key()
105
107
 
106
108
 
107
109
  @pytest.mark.asyncio
108
- async def test_union_tokenvalid(oauth2_client):
109
- client = oauth2_client(UnionClient)
110
+ @pytest.mark.parametrize("union_client_type", [UnionClient, SetuppyUnionClient])
111
+ async def test_union_tokenvalid(oauth2_client, union_client_type):
112
+ client = oauth2_client(union_client_type)
110
113
  await client.valid_token(enforce_https=False)
111
114
 
112
115
 
@@ -7,6 +7,7 @@ import pytest
7
7
  from authentication.apikey import ApiKeyClient
8
8
  from authentication.oauth2 import OAuth2Client
9
9
  from authentication.union import UnionClient
10
+ from setuppy.authentication.union import UnionClient as SetuppyUnionClient
10
11
  from authentication.http.custom import CustomClient
11
12
 
12
13
 
@@ -94,13 +95,15 @@ def test_oauth2_invalid(oauth2_client, core_library):
94
95
  assert ex.value.status_code == 403
95
96
 
96
97
 
97
- def test_union_keyvalid(api_key_client):
98
- client = api_key_client(UnionClient)
98
+ @pytest.mark.parametrize("union_client_type", [UnionClient, SetuppyUnionClient])
99
+ def test_union_keyvalid(api_key_client, union_client_type):
100
+ client = api_key_client(union_client_type)
99
101
  client.valid_key()
100
102
 
101
103
 
102
- def test_union_tokenvalid(oauth2_client):
103
- client = oauth2_client(UnionClient)
104
+ @pytest.mark.parametrize("union_client_type", [UnionClient, SetuppyUnionClient])
105
+ def test_union_tokenvalid(oauth2_client, union_client_type):
106
+ client = oauth2_client(union_client_type)
104
107
  client.valid_token(enforce_https=False)
105
108
 
106
109
 
@@ -54,4 +54,6 @@ def test_sensitive_word():
54
54
  check_folder = (Path(os.path.dirname(__file__)) / "../generated").resolve()
55
55
  assert [] == check_sensitive_word(check_folder, "azure")
56
56
  # after update spector, it shall also equal to []
57
- assert ["authentication-oauth2", "authentication-union"] == check_sensitive_word(check_folder, "microsoft")
57
+ assert ["authentication-oauth2", "authentication-union", "setuppy-authentication-union"] == check_sensitive_word(
58
+ check_folder, "microsoft"
59
+ )
@@ -6,6 +6,7 @@
6
6
  -e ./generated/authentication-http-custom
7
7
  -e ./generated/authentication-oauth2
8
8
  -e ./generated/authentication-union
9
+ -e ./generated/setuppy-authentication-union
9
10
  -e ./generated/encode-duration
10
11
  -e ./generated/encode-numeric
11
12
  -e ./generated/parameters-basic
@@ -20,7 +20,7 @@ commands =
20
20
  python ../../../eng/scripts/ci/run_pyright.py -t unbranded -s "generated" {posargs}
21
21
 
22
22
  # apiview
23
- pip install apiview-stub-generator==0.3.13 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
23
+ pip install apiview-stub-generator==0.3.19 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
24
24
  python ../../../eng/scripts/ci/run_apiview.py -t unbranded -s "generated" {posargs}
25
25
 
26
26
  [testenv:test]
@@ -52,5 +52,5 @@ commands =
52
52
  deps=
53
53
  -r requirements.txt
54
54
  commands =
55
- pip install apiview-stub-generator==0.3.13 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
55
+ pip install apiview-stub-generator==0.3.19 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
56
56
  python ../../../eng/scripts/ci/run_apiview.py -t unbranded -s "generated" {posargs}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/http-client-python",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec emitter for Python SDKs",
6
6
  "homepage": "https://typespec.io",