Skip to content

Commit 0ba1bdd

Browse files
authored
[Python] fix for setup.py (#7007)
fix for #6977 Here is generated code of autorest.python repo: Azure/autorest.python#3073
1 parent 94f373b commit 0ba1bdd

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@typespec/http-client-python"
5+
---
6+
7+
Fix for setup.py

packages/http-client-python/generator/pygen/codegen/serializers/general_serializer.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
from .base_serializer import BaseSerializer
1818

1919
VERSION_MAP = {
20-
"msrest": "0.7.1",
21-
"isodate": "0.6.1",
22-
"azure-mgmt-core": "1.3.2",
23-
"azure-core": "1.30.0",
24-
"typing-extensions": "4.6.0",
25-
"corehttp": "1.0.0b6",
20+
"msrest": "0.7.1",
21+
"isodate": "0.6.1",
22+
"azure-mgmt-core": "1.3.2",
23+
"azure-core": "1.30.0",
24+
"typing-extensions": "4.6.0",
25+
"corehttp": "1.0.0b6",
2626
}
2727

2828
MIN_PYTHON_VERSION = "3.9"
@@ -34,7 +34,11 @@ class GeneralSerializer(BaseSerializer):
3434

3535
def serialize_setup_file(self) -> str:
3636
template = self.env.get_template("packaging_templates/setup.py.jinja2")
37-
params = {}
37+
params = {
38+
"VERSION_MAP": VERSION_MAP,
39+
"MIN_PYTHON_VERSION": MIN_PYTHON_VERSION,
40+
"MAX_PYTHON_VERSION": MAX_PYTHON_VERSION,
41+
}
3842
params.update(self.code_model.options)
3943
return template.render(code_model=self.code_model, **params)
4044

packages/http-client-python/generator/pygen/codegen/templates/packaging_templates/setup.py.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ setup(
6969
"Programming Language :: Python",
7070
"Programming Language :: Python :: 3 :: Only",
7171
"Programming Language :: Python :: 3",
72-
{% for version in range(min_version, max_version) %}
72+
{% for version in range(min_version, max_version + 1) %}
7373
"Programming Language :: Python :: 3.{{ version }}",
7474
{% endfor %}
7575
"License :: OSI Approved :: MIT License",

0 commit comments

Comments
 (0)