Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

v2 module import cleanup #111

Merged
merged 5 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public AbstractPythonCodegen() {
"assert", "else", "if", "pass", "yield", "break", "except", "import",
"print", "class", "exec", "in", "raise", "continue", "finally", "is",
"return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True",
"False", "async", "await"));
"False", "async", "await",
// imports, imports_schema_types.handlebars, include these to prevent name collision
"datetime", "decimal", "functools", "io", "re",
"typing", "typing_extensions", "uuid", "frozendict", "schemas"
));

languageSpecificPrimitives.clear();
languageSpecificPrimitives.add("int");
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date, datetime # noqa: F401
import datetime # noqa: F401
import decimal # noqa: F401
import functools # noqa: F401
import io # noqa: F401
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __new__(
{{/if}}
{{/if}}
{{/each}}
_configuration: typing.Optional[schemas.Configuration] = None,
_configuration: typing.Optional[schemas.configuration_module.Configuration] = None,
{{#with additionalProperties}}
{{#unless getIsBooleanSchemaFalse}}
{{#if refClass}}
Expand All @@ -52,7 +52,7 @@ def __new__(
{{/unless}}
{{else}}
{{#or isMap isAnyType}}
**kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
**kwargs: typing.Union[{{> types_all_incl_schema_oneline }}],
{{/or}}
{{/with}}
) -> '{{name.getCamelCaseName}}':
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#if isAnyType}}dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict.frozendict, {{/if}}{{#if isNull}}None, {{/if}}{{#if isString }}{{#neq format "binary"}}str, {{/neq}}{{#eq format "date"}}date, {{/eq}}{{#eq format "date-time"}}datetime, {{/eq}}{{#eq format "uuid"}}uuid.UUID, {{/eq}}{{#eq format "binary"}}bytes, io.FileIO, io.BufferedReader, {{/eq}}{{/if}}{{#if isInteger}}decimal.Decimal, int, {{/if}}{{#if isNumber}}decimal.Decimal, int, float, {{/if}}{{#if isBoolean}}bool, {{/if}}
{{#if isAnyType}}dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict.frozendict, {{/if}}{{#if isNull}}None, {{/if}}{{#if isString }}{{#neq format "binary"}}str, {{/neq}}{{#eq format "date"}}datetime.date, {{/eq}}{{#eq format "date-time"}}datetime.datetime, {{/eq}}{{#eq format "uuid"}}uuid.UUID, {{/eq}}{{#eq format "binary"}}bytes, io.FileIO, io.BufferedReader, {{/eq}}{{/if}}{{#if isInteger}}decimal.Decimal, int, {{/if}}{{#if isNumber}}decimal.Decimal, int, float, {{/if}}{{#if isBoolean}}bool, {{/if}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dataclasses
from datetime import date, datetime
import datetime
import decimal
import io
import typing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Key | Input Type | Accessed Type | Description | Notes
{{/if}}
{{/unless}}
{{else}}
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]
**any_string_name** | {{> types_all_incl_schema_oneline }} | {{> types_all_accessed_oneline }} | any string name can be used but the value must be the correct type | [optional]
{{/with}}
{{/or}}
{{#each requiredProperties}}
Expand Down
Loading