Skip to content

Commit

Permalink
python: remove aenum in favor of stdlib's enum (#16691)
Browse files Browse the repository at this point in the history
The aenum dependency didn't provide any specific improvements over the
stdlib's enum module.
aenum also doesn't provide typing information at the moment.

This removes one dependency and will help for completing the typing of
the generated client.
  • Loading branch information
multani authored Oct 1, 2023
1 parent 56bc383 commit 03781d3
Show file tree
Hide file tree
Showing 33 changed files with 40 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ To be able to use it, you will need these dependencies in your own package that
* tornado>=4.2,<5
{{/tornado}}
* pydantic
* aenum

## Getting Started

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum
{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pem = ">= 19.3.0"
pycryptodome = ">= 3.9.0"
{{/hasHttpSignatureMethods}}
pydantic = ">=2"
aenum = ">=3.1.11"
typing-extensions = ">=4.7.1"

[tool.poetry.dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2
aenum >= 3.1.11
typing-extensions >= 4.7.1
{{#asyncio}}
aiohttp >= 3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ REQUIRES = [
"pycryptodome>=3.9.0",
{{/hasHttpSignatureMethods}}
"pydantic >= 2",
"aenum",
"typing-extensions >= 4.7.1",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
1 change: 0 additions & 1 deletion samples/client/echo_api/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ python = "^3.7"
urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
pydantic = ">=2"
aenum = ">=3.1.11"
typing-extensions = ">=4.7.1"

[tool.poetry.dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion samples/client/echo_api/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2
aenum >= 3.1.11
typing-extensions >= 4.7.1
1 change: 0 additions & 1 deletion samples/client/echo_api/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"urllib3 >= 1.25.3, < 2.1.0",
"python-dateutil",
"pydantic >= 2",
"aenum",
"typing-extensions >= 4.7.1",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ aiohttp = ">= 3.8.4"
pem = ">= 19.3.0"
pycryptodome = ">= 3.9.0"
pydantic = ">=2"
aenum = ">=3.1.11"
typing-extensions = ">=4.7.1"

[tool.poetry.dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2
aenum >= 3.1.11
typing-extensions >= 4.7.1
aiohttp >= 3.0.0
pycryptodome >= 3.9.0
1 change: 0 additions & 1 deletion samples/openapi3/client/petstore/python-aiohttp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"pem>=19.3.0",
"pycryptodome>=3.9.0",
"pydantic >= 2",
"aenum",
"typing-extensions >= 4.7.1",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
""" # noqa: E501


from __future__ import annotations
import json
import pprint
import re # noqa: F401
from aenum import Enum, no_arg
from enum import Enum



Expand Down
1 change: 0 additions & 1 deletion samples/openapi3/client/petstore/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ python-dateutil = ">=2.8.2"
pem = ">= 19.3.0"
pycryptodome = ">= 3.9.0"
pydantic = ">=2"
aenum = ">=3.1.11"
typing-extensions = ">=4.7.1"

[tool.poetry.dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion samples/openapi3/client/petstore/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2
aenum >= 3.1.11
typing-extensions >= 4.7.1
pycryptodome >= 3.9.0
1 change: 0 additions & 1 deletion samples/openapi3/client/petstore/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"pem>=19.3.0",
"pycryptodome>=3.9.0",
"pydantic >= 2",
"aenum",
"typing-extensions >= 4.7.1",
]

Expand Down

0 comments on commit 03781d3

Please sign in to comment.