@autorest/python 6.32.2 → 6.33.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 (52) hide show
  1. package/autorest/m2r.py +1 -2
  2. package/autorest/m4reformatter/__init__.py +1 -2
  3. package/autorest/multiapi/models/imports.py +7 -2
  4. package/autorest/multiapi/templates/multiapi_service_client.py.jinja2 +13 -2
  5. package/autorest/preprocess.py +1 -2
  6. package/generator/build/lib/pygen/codegen/__init__.py +0 -1
  7. package/generator/build/lib/pygen/codegen/_utils.py +1 -1
  8. package/generator/build/lib/pygen/codegen/models/client.py +39 -2
  9. package/generator/build/lib/pygen/codegen/models/enum_type.py +2 -2
  10. package/generator/build/lib/pygen/codegen/models/imports.py +2 -13
  11. package/generator/build/lib/pygen/codegen/models/model_type.py +1 -1
  12. package/generator/build/lib/pygen/codegen/serializers/builder_serializer.py +1 -3
  13. package/generator/build/lib/pygen/codegen/serializers/client_serializer.py +32 -6
  14. package/generator/build/lib/pygen/codegen/serializers/general_serializer.py +20 -1
  15. package/generator/build/lib/pygen/codegen/serializers/sample_serializer.py +2 -2
  16. package/generator/build/lib/pygen/codegen/templates/client.py.jinja2 +1 -1
  17. package/generator/build/lib/pygen/codegen/templates/config.py.jinja2 +2 -8
  18. package/generator/build/lib/pygen/codegen/templates/model_base.py.jinja2 +9 -13
  19. package/generator/build/lib/pygen/codegen/templates/packaging_templates/README.md.jinja2 +2 -2
  20. package/generator/build/lib/pygen/codegen/templates/packaging_templates/setup.py.jinja2 +12 -12
  21. package/generator/component-detection-pip-report.json +70 -71
  22. package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
  23. package/generator/pygen/codegen/__init__.py +0 -1
  24. package/generator/pygen/codegen/_utils.py +1 -1
  25. package/generator/pygen/codegen/models/client.py +39 -2
  26. package/generator/pygen/codegen/models/enum_type.py +2 -2
  27. package/generator/pygen/codegen/models/imports.py +2 -13
  28. package/generator/pygen/codegen/models/model_type.py +1 -1
  29. package/generator/pygen/codegen/serializers/builder_serializer.py +1 -3
  30. package/generator/pygen/codegen/serializers/client_serializer.py +32 -6
  31. package/generator/pygen/codegen/serializers/general_serializer.py +20 -1
  32. package/generator/pygen/codegen/serializers/sample_serializer.py +2 -2
  33. package/generator/pygen/codegen/templates/client.py.jinja2 +1 -1
  34. package/generator/pygen/codegen/templates/config.py.jinja2 +2 -8
  35. package/generator/pygen/codegen/templates/model_base.py.jinja2 +9 -13
  36. package/generator/pygen/codegen/templates/packaging_templates/README.md.jinja2 +2 -2
  37. package/generator/pygen/codegen/templates/packaging_templates/setup.py.jinja2 +12 -12
  38. package/generator/pygen.egg-info/PKG-INFO +0 -1
  39. package/generator/setup.py +0 -1
  40. package/package.json +2 -2
  41. package/scripts/__pycache__/venvtools.cpython-310.pyc +0 -0
  42. package/scripts/eng/mypy.ini +1 -1
  43. package/scripts/eng/pylintrc +1 -1
  44. package/scripts/eng/pyrightconfig.json +1 -1
  45. package/scripts/install.py +3 -3
  46. package/scripts/mypy.ini +1 -1
  47. package/scripts/prepare.py +2 -2
  48. package/scripts/run-python3.js +1 -1
  49. package/scripts/run-python3.ts +1 -1
  50. package/scripts/start.py +2 -2
  51. package/scripts/venvtools.py +0 -3
  52. package/setup.py +0 -1
@@ -1,4 +1,6 @@
1
1
  # coding=utf-8
2
+ {% set min_version = MIN_PYTHON_VERSION.split('.')[1] | int %}
3
+ {% set max_version = MAX_PYTHON_VERSION.split('.')[1] | int %}
2
4
  {% if code_model.license_header %}
3
5
  {{ code_model.license_header }}
4
6
  {% endif %}
@@ -67,11 +69,9 @@ setup(
67
69
  "Programming Language :: Python",
68
70
  "Programming Language :: Python :: 3 :: Only",
69
71
  "Programming Language :: Python :: 3",
70
- "Programming Language :: Python :: 3.8",
71
- "Programming Language :: Python :: 3.9",
72
- "Programming Language :: Python :: 3.10",
73
- "Programming Language :: Python :: 3.11",
74
- "Programming Language :: Python :: 3.12",
72
+ {% for version in range(min_version, max_version + 1) %}
73
+ "Programming Language :: Python :: 3.{{ version }}",
74
+ {% endfor %}
75
75
  "License :: OSI Approved :: MIT License",
76
76
  ],
77
77
  zip_safe=False,
@@ -96,21 +96,21 @@ setup(
96
96
  {% endif %}
97
97
  install_requires=[
98
98
  {% if code_model.is_legacy %}
99
- "msrest>=0.7.1",
99
+ "msrest>={{ VERSION_MAP["msrest"] }}",
100
100
  {% else %}
101
- "isodate>=0.6.1",
101
+ "isodate>={{ VERSION_MAP["isodate"] }}",
102
102
  {% endif %}
103
103
  {% if azure_arm %}
104
- "azure-mgmt-core>=1.3.2",
104
+ "azure-mgmt-core>={{ VERSION_MAP["azure-mgmt-core"] }}",
105
105
  {% elif code_model.is_azure_flavor %}
106
- "azure-core>=1.30.0",
106
+ "azure-core>={{ VERSION_MAP["azure-core"] }}",
107
107
  {% else %}
108
- "corehttp[requests]",
108
+ "corehttp[requests]>={{ VERSION_MAP["corehttp"] }}",
109
109
  {% endif %}
110
- "typing-extensions>=4.6.0",
110
+ "typing-extensions>={{ VERSION_MAP['typing-extensions'] }}",
111
111
  ],
112
112
  {% if package_mode %}
113
- python_requires=">=3.8",
113
+ python_requires=">={{ MIN_PYTHON_VERSION }}",
114
114
  {% else %}
115
115
  long_description="""\
116
116
  {{ code_model.description }}
@@ -9,7 +9,6 @@ License: MIT License
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Programming Language :: Python
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
12
  Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
@@ -35,7 +35,6 @@ setup(
35
35
  "Development Status :: 4 - Beta",
36
36
  "Programming Language :: Python",
37
37
  "Programming Language :: Python :: 3",
38
- "Programming Language :: Python :: 3.8",
39
38
  "Programming Language :: Python :: 3.9",
40
39
  "Programming Language :: Python :: 3.10",
41
40
  "Programming Language :: Python :: 3.11",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.32.2",
3
+ "version": "6.33.0",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
21
21
  "dependencies": {
22
- "@typespec/http-client-python": "~0.9.1",
22
+ "@typespec/http-client-python": "~0.10.0",
23
23
  "@autorest/system-requirements": "~1.0.2",
24
24
  "fs-extra": "~11.2.0",
25
25
  "tsx": "~4.19.1"
@@ -1,6 +1,6 @@
1
1
  # global configurations
2
2
  [mypy]
3
- python_version = 3.8
3
+ python_version = 3.9
4
4
 
5
5
 
6
6
  # module level configurations
@@ -1,5 +1,5 @@
1
1
  [MASTER]
2
- py-version=3.8
2
+ py-version=3.9
3
3
  ignore-patterns=test_*,conftest,setup
4
4
  reports=no
5
5
 
@@ -2,5 +2,5 @@
2
2
  "reportUnnecessaryCast": "warning",
3
3
  "reportTypeCommentUsage": true,
4
4
  "reportMissingImports": false,
5
- "pythonVersion": "3.8"
5
+ "pythonVersion": "3.9"
6
6
  }
@@ -7,8 +7,8 @@
7
7
  # --------------------------------------------------------------------------
8
8
  import sys
9
9
 
10
- if not sys.version_info >= (3, 8, 0):
11
- raise Exception("Autorest for Python extension requires Python 3.8 at least")
10
+ if not sys.version_info >= (3, 9, 0):
11
+ raise Exception("Autorest for Python extension requires Python 3.9 at least")
12
12
 
13
13
  try:
14
14
  import pip
@@ -21,7 +21,7 @@ except ImportError:
21
21
  raise Exception("Your Python installation doesn't have venv available")
22
22
 
23
23
 
24
- # Now we have pip and Py >= 3.8, go to work
24
+ # Now we have pip and Py >= 3.9, go to work
25
25
 
26
26
  from pathlib import Path
27
27
 
package/scripts/mypy.ini CHANGED
@@ -1,6 +1,6 @@
1
1
  # global configurations
2
2
  [mypy]
3
- python_version = 3.8
3
+ python_version = 3.9
4
4
 
5
5
 
6
6
  # module level configurations
@@ -9,8 +9,8 @@ import sys
9
9
  import os
10
10
  import argparse
11
11
 
12
- if not sys.version_info >= (3, 8, 0):
13
- raise Exception("Autorest for Python extension requires Python 3.8 at least")
12
+ if not sys.version_info >= (3, 9, 0):
13
+ raise Exception("Autorest for Python extension requires Python 3.9 at least")
14
14
 
15
15
  from pathlib import Path
16
16
  import venv
@@ -10,7 +10,7 @@ const cp = require("child_process");
10
10
  const extension = require("@autorest/system-requirements");
11
11
 
12
12
  async function runPython3(scriptName, ...args) {
13
- const command = await extension.patchPythonPath(["python", scriptName, ...args], { version: ">=3.8", environmentVariable: "AUTOREST_PYTHON_EXE" });
13
+ const command = await extension.patchPythonPath(["python", scriptName, ...args], { version: ">=3.9", environmentVariable: "AUTOREST_PYTHON_EXE" });
14
14
  cp.execSync(command.join(" "), {
15
15
  stdio: [0, 1, 2]
16
16
  });
@@ -11,7 +11,7 @@ import { patchPythonPath } from "./system-requirements.js";
11
11
 
12
12
  async function runPython3(...args: string[]) {
13
13
  const command = await patchPythonPath(["python", ...args], {
14
- version: ">=3.8",
14
+ version: ">=3.9",
15
15
  environmentVariable: "AUTOREST_PYTHON_EXE",
16
16
  });
17
17
  cp.execSync(command.join(" "), {
package/scripts/start.py CHANGED
@@ -7,8 +7,8 @@
7
7
  # --------------------------------------------------------------------------
8
8
  import sys
9
9
 
10
- if not sys.version_info >= (3, 8, 0):
11
- raise Exception("Autorest for Python extension requires Python 3.8 at least")
10
+ if not sys.version_info >= (3, 9, 0):
11
+ raise Exception("Autorest for Python extension requires Python 3.9 at least")
12
12
 
13
13
  from pathlib import Path
14
14
  import venv
@@ -21,9 +21,6 @@ class ExtendedEnvBuilder(venv.EnvBuilder):
21
21
 
22
22
  def __init__(self, *args, **kwargs):
23
23
  self.context = None
24
- if sys.version_info < (3, 9, 0):
25
- # Not supported on Python 3.8, and we don't need it
26
- kwargs.pop("upgrade_deps", None)
27
24
  super().__init__(*args, **kwargs)
28
25
 
29
26
  def ensure_directories(self, env_dir):
package/setup.py CHANGED
@@ -34,7 +34,6 @@ setup(
34
34
  "Development Status :: 4 - Beta",
35
35
  "Programming Language :: Python",
36
36
  "Programming Language :: Python :: 3",
37
- "Programming Language :: Python :: 3.8",
38
37
  "Programming Language :: Python :: 3.9",
39
38
  "Programming Language :: Python :: 3.10",
40
39
  "Programming Language :: Python :: 3.11",