diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index d9ab10d571..bf97897403 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -140,6 +140,20 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { supportingFiles.remove(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); + supportingFiles.remove(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); + supportingFiles.add(new SupportingFile("python-experimental/configuration.mustache", packagePath(), "configuration.py")); + + supportingFiles.remove(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py")); + supportingFiles.add(new SupportingFile("python-experimental/__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py")); + + supportingFiles.remove(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py")); + supportingFiles.add(new SupportingFile("python-experimental/exceptions.mustache", packagePath(), "exceptions.py")); + + if ("urllib3".equals(getLibrary())) { + supportingFiles.remove(new SupportingFile("rest.mustache", packagePath(), "rest.py")); + supportingFiles.add(new SupportingFile("python-experimental/rest.mustache", packagePath(), "rest.py")); + } + supportingFiles.remove(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py")); @@ -176,12 +190,18 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); if (!generateSourceCodeOnly) { - supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); - supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); - supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); - supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.remove(new SupportingFile("travis.mustache", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("python-experimental/travis.mustache", "", ".travis.yml")); + supportingFiles.remove(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); + supportingFiles.add(new SupportingFile("python-experimental/gitlab-ci.mustache", "", ".gitlab-ci.yml")); + supportingFiles.remove(new SupportingFile("tox.mustache", "", "tox.ini")); + supportingFiles.add(new SupportingFile("python-experimental/tox.mustache", "", "tox.ini")); + supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); + supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); + supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); } // default this to true so the python ModelSimple models will be generated diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache index 72c7f3de3f..3fb507c574 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index 0f6dcb41d6..b996e676d1 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -1,5 +1,4 @@ ```python -from __future__ import print_function {{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache index 11c002c9aa..ee90ce7903 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache @@ -26,7 +26,6 @@ This python library package is generated without supporting files like setup.py To be able to use it, you will need these dependencies in your own package that uses this library: * urllib3 >= 1.15 -* six >= 1.10 * certifi * python-dateutil {{#asyncio}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache index d37ee6c78b..1d37d33951 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache @@ -1,3 +1,3 @@ # do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with +# if you need the ability to import all apis from one package, import them with # from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index a949d50850..d0746d3aa6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -4,8 +4,6 @@ {{>partial_header}} -from __future__ import absolute_import - __version__ = "{{packageVersion}}" # import ApiClient diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index ad5decabf0..776acbf5ec 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -2,14 +2,9 @@ {{>partial_header}} -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from {{packageName}}.api_client import ApiClient, Endpoint from {{packageName}}.model_utils import ( # noqa: F401 check_allowed_values, @@ -17,9 +12,7 @@ from {{packageName}}.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) {{#imports}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index d3b0b6f60e..b7112d202b 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -1,6 +1,5 @@ # coding: utf-8 {{>partial_header}} -from __future__ import absolute_import import json import atexit @@ -8,10 +7,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote {{#tornado}} import tornado.gen {{/tornado}} @@ -29,10 +26,8 @@ from {{packageName}}.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -59,10 +54,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -189,7 +182,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -207,7 +200,7 @@ class ApiClient(object): {{/tornado}} return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -277,7 +270,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -477,7 +470,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -508,7 +501,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -692,7 +685,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -714,7 +707,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -772,7 +765,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache index 23cf85e9df..b7bbc009f5 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache @@ -1,5 +1,4 @@ ```python -from __future__ import print_function import time import {{{packageName}}} from {{apiPackage}} import {{classVarName}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache index e04b32f96e..f9276b443c 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import unittest import {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache new file mode 100644 index 0000000000..8b911bdddd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache @@ -0,0 +1,632 @@ +# coding: utf-8 + +{{>partial_header}} + +import copy +import logging +{{^asyncio}} +import multiprocessing +{{/asyncio}} +import sys +import urllib3 + +from http import client as http_client +from {{packageName}}.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. +{{#hasHttpSignatureMethods}} + :param signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + +{{#hasAuthMethods}} + :Example: +{{#hasApiKeyMethods}} + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = {{{packageName}}}.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 +{{/hasApiKeyMethods}} +{{#hasHttpBasicMethods}} + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', +) + +{{/hasHttpBasicMethods}} +{{#hasHttpSignatureMethods}} + + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the {{{packageName}}}.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + +conf = {{{packageName}}}.Configuration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, + signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) +{{/hasHttpSignatureMethods}} +{{/hasAuthMethods}} + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", +{{#hasHttpSignatureMethods}} + signing_info=None, +{{/hasHttpSignatureMethods}} + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ): + """Constructor + """ + self._base_path = "{{{basePath}}}" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations +{{#hasHttpSignatureMethods}} + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ +{{/hasHttpSignatureMethods}} +{{#hasOAuthMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/hasOAuthMethods}} +{{^hasOAuthMethods}} +{{#hasBearerMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/hasBearerMethods}} +{{/hasOAuthMethods}} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("{{packageName}}") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + {{#asyncio}} + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + {{/asyncio}} + {{^asyncio}} + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + {{/asyncio}} + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s +{{#hasHttpSignatureMethods}} + if name == "signing_info" and value is not None: + # Ensure the host paramater from signing info is the same as + # Configuration.host. + value.host = self.host +{{/hasHttpSignatureMethods}} + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} +{{#authMethods}} +{{#isApiKey}} + if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}: + auth['{{name}}'] = { + 'type': 'api_key', + 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + 'key': '{{keyParamName}}', + 'value': self.get_api_key_with_prefix( + '{{name}}',{{#vendorExtensions.x-auth-id-alias}} + alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}} + ), + } +{{/isApiKey}} +{{#isBasic}} + {{#isBasicBasic}} + if self.username is not None and self.password is not None: + auth['{{name}}'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + {{/isBasicBasic}} + {{#isBasicBearer}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'bearer', + 'in': 'header', + {{#bearerFormat}} + 'format': '{{{.}}}', + {{/bearerFormat}} + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + {{/isBasicBearer}} + {{#isHttpSignature}} + if self.signing_info is not None: + auth['{{name}}'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } + {{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } +{{/isOAuth}} +{{/authMethods}} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: {{version}}\n"\ + "SDK Package Version: {{packageVersion}}".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + {{#servers}} + { + 'url': "{{{url}}}", + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + 'variables': { + {{/-first}} + '{{{name}}}': { + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + 'default_value': "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + 'enum_values': [ + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + }{{^-last}},{{/-last}} + {{#-last}} + } + {{/-last}} + {{/variables}} + }{{^-last}},{{/-last}} + {{/servers}} + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache new file mode 100644 index 0000000000..8d445c6e24 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache @@ -0,0 +1,129 @@ +# coding: utf-8 + +{{>partial_header}} + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache new file mode 100644 index 0000000000..a626e9c084 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache @@ -0,0 +1,35 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.nosetest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + {{#useNose}} + - nosetests + {{/useNose}} + {{^useNose}} + - pytest --cov={{{packageName}}} + {{/useNose}} + +nosetest-3.3: + extends: .nosetest + image: python:3.3-alpine +nosetest-3.4: + extends: .nosetest + image: python:3.4-alpine +nosetest-3.5: + extends: .nosetest + image: python:3.5-alpine +nosetest-3.6: + extends: .nosetest + image: python:3.6-alpine +nosetest-3.7: + extends: .nosetest + image: python:3.7-alpine +nosetest-3.8: + extends: .nosetest + image: python:3.8-alpine diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index e89b3d5633..ad7d5ddb31 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -2,11 +2,9 @@ {{>partial_header}} -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from {{packageName}}.model_utils import ( # noqa: F401 @@ -20,9 +18,7 @@ from {{packageName}}.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) {{#models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache index 67750cb17a..7e64549acd 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache @@ -41,7 +41,7 @@ for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache index 7faf7a30ee..4fee1c8449 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache @@ -15,7 +15,7 @@ {{#requiredVars}} self.{{name}} = {{name}} {{/requiredVars}} - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache index d01d49ad77..17c441196a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache @@ -13,17 +13,12 @@ if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache index 0bba565d22..4a7ef6ae5c 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache @@ -13,10 +13,4 @@ types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True \ No newline at end of file + return vals_equal \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache index 5b9a91d2d0..c5ffe2c255 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache @@ -2,7 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import import sys import unittest diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 1323b72499..ab30c2dcb0 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -4,13 +4,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from {{packageName}}.exceptions import ( ApiKeyError, @@ -20,20 +20,7 @@ from {{packageName}}.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -380,8 +367,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -389,8 +374,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -835,12 +819,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -964,8 +948,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1184,7 +1168,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1218,7 +1202,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1275,13 +1259,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: @@ -1289,15 +1268,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1340,7 +1310,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1349,7 +1319,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache index a56bedffbf..2c2f00fcb2 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache new file mode 100644 index 0000000000..d5edf9535d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache @@ -0,0 +1,279 @@ +# coding: utf-8 + +{{>partial_header}} + +import io +import json +import logging +import re +import ssl +from urllib.parse import urlencode + +import certifi +import urllib3 + +from {{packageName}}.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, int): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index 796475c456..b3c89f621e 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -18,7 +18,6 @@ VERSION = "{{packageVersion}}" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", @@ -33,7 +32,6 @@ REQUIRES = [ "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -43,8 +41,8 @@ setup( author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, {{#licenseInfo}}license="{{licenseInfo}}", diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 0be0e1c467..26d2b8cb37 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -1,6 +1,5 @@ # coding: utf-8 {{>partial_header}} -from __future__ import absolute_import from base64 import b64encode from Crypto.IO import PEM, PKCS8 @@ -11,8 +10,8 @@ from email.utils import formatdate import json import os import re -from six.moves.urllib.parse import urlencode, urlparse from time import time +from urllib.parse import urlencode, urlparse # The constants below define a subset of HTTP headers that can be included in the # HTTP signature scheme. Additional headers may be included in the signature. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index ebdee3392e..cc68f6484f 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -6,11 +6,10 @@ py>=1.4.31 randomize>=0.13 {{/useNose}} {{^useNose}} -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 +pytest-randomly==1.2.3 # needed for python 3.4 {{/useNose}} {{#hasHttpSignatureMethods}} pycryptodome>=3.9.0 -{{/hasHttpSignatureMethods}} -mock; python_version<="2.7" \ No newline at end of file +{{/hasHttpSignatureMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache new file mode 100644 index 0000000000..4c771c472b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache new file mode 100644 index 0000000000..77f7289f97 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache @@ -0,0 +1,21 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +{{#useNose}} +script: nosetests +{{/useNose}} +{{^useNose}} +script: pytest --cov={{{packageName}}} +{{/useNose}} diff --git a/samples/client/petstore/python-experimental/.gitlab-ci.yml b/samples/client/petstore/python-experimental/.gitlab-ci.yml index 142ce3712e..9703213bb0 100644 --- a/samples/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/client/petstore/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/client/petstore/python-experimental/.travis.yml b/samples/client/petstore/python-experimental/.travis.yml index fcd7e31c7c..3aa7c047e1 100644 --- a/samples/client/petstore/python-experimental/.travis.yml +++ b/samples/client/petstore/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/client/petstore/python-experimental/Makefile b/samples/client/petstore/python-experimental/Makefile index a7ff5e1e24..a6bbba4a43 100644 --- a/samples/client/petstore/python-experimental/Makefile +++ b/samples/client/petstore/python-experimental/Makefile @@ -15,7 +15,4 @@ clean: find . -name "__pycache__" -delete test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh + bash ./test_python.sh diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 62a22ec0ed..c265bc3767 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import petstore_api Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import petstore_api diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 8b7a611094..8b25ae1687 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -17,7 +17,6 @@ To test special tags and operation ID starting with number ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import another_fake_api diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index eeabb02c3c..b50d11670a 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -32,7 +32,6 @@ Test serialization of ArrayModel ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -96,7 +95,6 @@ Test serialization of outer boolean types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -159,7 +157,6 @@ this route creates an XmlItem ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -222,7 +219,6 @@ Test serialization of outer number types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -286,7 +282,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -350,7 +345,6 @@ Test serialization of outer string types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -413,7 +407,6 @@ Test serialization of outer enum ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -477,7 +470,6 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -537,7 +529,6 @@ No authorization required ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -601,7 +592,6 @@ To test \"client\" model ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -665,7 +655,6 @@ This route has required values with enums of 1 ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -730,7 +719,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ * Basic Authentication (http_basic_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -837,7 +825,6 @@ To test enum parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -915,7 +902,6 @@ Fake endpoint to test group parameters (optional) ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -993,7 +979,6 @@ test inline additionalProperties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1053,7 +1038,6 @@ test json serialization of form data ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 6cc2461949..aad73f70f5 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -18,7 +18,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_classname_tags_123_api diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 20b56372d8..287cbc2f7d 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -24,7 +24,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -97,7 +96,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -181,7 +179,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -257,7 +254,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -333,7 +329,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -412,7 +407,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -487,7 +481,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -570,7 +563,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -658,7 +650,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 36e72b2ac4..33db4f14ee 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -20,7 +20,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -84,7 +83,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -157,7 +155,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -221,7 +218,6 @@ Place an order for a pet ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 4727961273..db41065faf 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -24,7 +24,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -85,7 +84,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -146,7 +144,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -209,7 +206,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -270,7 +266,6 @@ Get user by user name ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -334,7 +329,6 @@ Logs user into the system ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -398,7 +392,6 @@ Logs out current logged in user session ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -456,7 +449,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py index 4af4353187..bd7096a818 100644 --- a/samples/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/api/__init__.py index 74496adb5a..1d37d33951 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -1,11 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 4324e43df1..3afdf63dfa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index d7607077f5..756329652d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import animal_farm diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index fb8838c8fc..c069a60b04 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 0acb59cc01..4ae5987ba0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import pet diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index 21f171650f..cc86ddc91c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import order diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 75a3b54b58..51d595d3f3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import user diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 891d42be49..0f7571e183 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration @@ -34,10 +31,8 @@ from petstore_api.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ class ApiClient(object): return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 81b2cd7e9d..b7e866546d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from petstore_api.exceptions import ApiValueError @@ -307,7 +304,7 @@ conf = petstore_api.Configuration( # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -329,17 +326,17 @@ conf = petstore_api.Configuration( self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/client/petstore/python-experimental/petstore_api/exceptions.py index b55977ee5e..fecd2081b8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/exceptions.py +++ b/samples/client/petstore/python-experimental/petstore_api/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py index 7ea7b1f807..ff57e565fa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesAnyType(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py index 5dc25499ea..c42ce98aee 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesArray(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py index ae3b7cd9dc..ff1f44523b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesBoolean(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index 1b98c5f06e..c52c9dd3b8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -193,7 +189,7 @@ class AdditionalPropertiesClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py index 005c26263a..31ab33a95b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesInteger(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py index fca97fca08..8f8f580c7a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesNumber(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py index 03ca022e6f..954b6b9657 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesObject(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py index 7144f66699..65a6719903 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class AdditionalPropertiesString(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/client/petstore/python-experimental/petstore_api/model/animal.py index 7ba62dad16..7f1257e2ab 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -185,7 +181,7 @@ class Animal(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 4030d038ed..94d6d094d6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py index c921519b87..24a2e3d897 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class ApiResponse(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index b9f52d6ba7..014740ca0a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 45021fef4c..00afce1fb4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ArrayOfNumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py index e2bc76832b..e4478c5acd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class ArrayTest(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py index 06745009d8..18c5f54c06 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -178,7 +174,7 @@ class Capitalization(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/client/petstore/python-experimental/petstore_api/model/cat.py index b40a97dbab..335b05559d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ class Cat(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 49ae9462f4..c257813c12 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class CatAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/category.py b/samples/client/petstore/python-experimental/petstore_api/model/category.py index 16e4a33d4f..e2be1802b1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/category.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ class Category(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child.py b/samples/client/petstore/python-experimental/petstore_api/model/child.py index 37c138d6a4..03b1839ccc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -206,7 +202,7 @@ class Child(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py index 26e6018acf..0aaf9f258b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ChildAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py index 6d42f11a18..998f062d67 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ class ChildCat(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 1ddf92fb12..cc67b70c87 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ChildCatAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py index b7a93571a6..4fea9fbfe0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ class ChildDog(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py index 7ba37f9908..6e3e49d360 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ChildDogAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py index 978fea14a1..741ef17af1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ class ChildLizard(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py index 78b69edb87..31976b59fa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ChildLizardAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py index fc88f68e3f..d80e4ef367 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ClassModel(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/client.py b/samples/client/petstore/python-experimental/petstore_api/model/client.py index fa99b07fa3..2ea3b4aadd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/client.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class Client(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/client/petstore/python-experimental/petstore_api/model/dog.py index 547eba90c2..02d6f03443 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ class Dog(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 0d053aca2a..299a4d956b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class DogAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index a199904497..161ddd5c1d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ class EnumArrays(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py index 7c5014fd53..dac3ee37d0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index 67916bf709..c53f054242 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -201,7 +197,7 @@ class EnumTest(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.enum_string_required = enum_string_required - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file.py b/samples/client/petstore/python-experimental/petstore_api/model/file.py index 0152f8d8c6..f7cdcb4fdf 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class File(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 0a9471e9e4..3c1d880d35 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -171,7 +167,7 @@ class FileSchemaTestClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py index 7c598ae438..1955422e7a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -240,7 +236,7 @@ class FormatTest(ModelNormal): self.byte = byte self.date = date self.password = password - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py index 3097bef04b..7d607a4f39 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class Grandparent(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 81947e1c49..2dc2658ef1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -194,7 +190,7 @@ class GrandparentAnimal(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.pet_type = pet_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index eeb685139c..7a722ee9c7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class HasOnlyReadOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/list.py b/samples/client/petstore/python-experimental/petstore_api/model/list.py index 9499f26c7b..77bd4d0565 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/list.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class List(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py index a22af06ce4..5bafea48a0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -181,7 +177,7 @@ class MapTest(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index a0fcac2eb0..12cda6cf9a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py index 54cc1fa338..ea4df21be4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class Model200Response(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py index cf7415f0bd..535657ebbc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ModelReturn(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/name.py b/samples/client/petstore/python-experimental/petstore_api/model/name.py index 33a95baafc..95f197a7a5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ class Name(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py index 305da1d753..d16ea3765f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class NumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index ed81cdce69..1cb824ca0b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index f76243bc36..15ccc61db3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class ObjectModelWithRefProps(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/order.py b/samples/client/petstore/python-experimental/petstore_api/model/order.py index ddc3332d66..b21543df95 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/order.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -183,7 +179,7 @@ class Order(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent.py b/samples/client/petstore/python-experimental/petstore_api/model/parent.py index a855a3ffd0..e304790e4a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -203,7 +199,7 @@ class Parent(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py index 28d5f07393..7c93bfa530 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ParentAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 0b0b30c656..be19773d59 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ class ParentPet(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/client/petstore/python-experimental/petstore_api/model/pet.py index 742d7cdf04..5837810f22 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -197,7 +193,7 @@ class Pet(ModelNormal): self.name = name self.photo_urls = photo_urls - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/player.py b/samples/client/petstore/python-experimental/petstore_api/model/player.py index d65e53c2e5..b24471bd4c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/player.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class Player(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 691d789a92..b53aa4db39 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class ReadOnlyFirst(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 6e2b80cbe9..75df4a577a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class SpecialModelName(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 8351ad04e2..b1fb643211 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ class StringBooleanMap(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index e8f184f4ae..6f45c19a4c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/client/petstore/python-experimental/petstore_api/model/tag.py index ee10817f13..480e1e6032 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/tag.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class Tag(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py index da92e2cb8a..4eb7092ef8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -192,7 +188,7 @@ class TypeHolderDefault(ModelNormal): self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py index 4253a0ce72..6e3cd4280b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -194,7 +190,7 @@ class TypeHolderExample(ModelNormal): self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/user.py b/samples/client/petstore/python-experimental/petstore_api/model/user.py index 6c6dcd1d28..95fd0683d7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/user.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -184,7 +180,7 @@ class User(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py index dc48355d3c..961fb0f555 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -247,7 +243,7 @@ class XmlItem(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index f15303a094..ff378aa1e1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from petstore_api.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ from petstore_api.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ class ModelSimple(OpenApiModel): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ class ModelNormal(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ class ModelComposed(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/client/petstore/python-experimental/petstore_api/rest.py b/samples/client/petstore/python-experimental/petstore_api/rest.py index 973161ca7a..fb424024af 100644 --- a/samples/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/client/petstore/python-experimental/petstore_api/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from petstore_api.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/client/petstore/python-experimental/pom.xml b/samples/client/petstore/python-experimental/pom.xml index 742451c23b..9dc399cc80 100644 --- a/samples/client/petstore/python-experimental/pom.xml +++ b/samples/client/petstore/python-experimental/pom.xml @@ -35,7 +35,7 @@ make - test-all + test diff --git a/samples/client/petstore/python-experimental/requirements.txt b/samples/client/petstore/python-experimental/requirements.txt index a56bedffbf..2c2f00fcb2 100644 --- a/samples/client/petstore/python-experimental/requirements.txt +++ b/samples/client/petstore/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index 09b715bbcc..eba01f249e 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -23,12 +23,10 @@ VERSION = "1.0.0" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ setup( author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/client/petstore/python-experimental/test-requirements.txt b/samples/client/petstore/python-experimental/test-requirements.txt index 06f7754d20..2d88b03419 100644 --- a/samples/client/petstore/python-experimental/test-requirements.txt +++ b/samples/client/petstore/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py index ce985f76ed..e87caa28bc 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py index f63ca82f6c..503b4952a2 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py index e5a13891c0..da5dc15469 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py index befc14455d..42fdf19487 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py index 0e08b8f877..e594f8207d 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py index 90f4429e98..d678ad4d65 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py index ded4a8e8a1..9088632e9f 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py index cff2c31921..29c09806c1 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py index 958f303f13..0e1f850737 100644 --- a/samples/client/petstore/python-experimental/test/test_animal.py +++ b/samples/client/petstore/python-experimental/test/test_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal_farm.py b/samples/client/petstore/python-experimental/test/test_animal_farm.py index 7117d42b43..f473c465d7 100644 --- a/samples/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-experimental/test/test_another_fake_api.py index f79966a269..c58dfa6202 100644 --- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-experimental/test/test_api_response.py index 9db92633f6..a9a900c29c 100644 --- a/samples/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/client/petstore/python-experimental/test/test_api_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 4980ad17af..39f8874a4e 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py index 479c537cad..c4abfd0686 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py index 2426b27b7e..f966f4c0d8 100644 --- a/samples/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/client/petstore/python-experimental/test/test_array_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-experimental/test/test_capitalization.py index 20d2649c01..5f47ddb4db 100644 --- a/samples/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/client/petstore/python-experimental/test/test_capitalization.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py index 64b525aaf1..5f6eba3f84 100644 --- a/samples/client/petstore/python-experimental/test/test_cat.py +++ b/samples/client/petstore/python-experimental/test/test_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_cat_all_of.py index a5bb91ac86..3d5a33d990 100644 --- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py index 59b64e5924..29490e0dbd 100644 --- a/samples/client/petstore/python-experimental/test/test_category.py +++ b/samples/client/petstore/python-experimental/test/test_category.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python-experimental/test/test_child.py index 51c0bb129d..7739901bd8 100644 --- a/samples/client/petstore/python-experimental/test/test_child.py +++ b/samples/client/petstore/python-experimental/test/test_child.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -89,7 +88,7 @@ class TestChild(unittest.TestCase): with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = child['invalid_variable'] # with getattr - self.assertEquals(getattr(child, 'invalid_variable', 'some value'), 'some value') + self.assertEqual(getattr(child, 'invalid_variable', 'some value'), 'some value') with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = getattr(child, 'invalid_variable') diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python-experimental/test/test_child_all_of.py index 96e479cf07..b216908b0a 100644 --- a/samples/client/petstore/python-experimental/test/test_child_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python-experimental/test/test_child_cat.py index 34c085515a..ba3c16543d 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a7aab100f..2a0b6b8c22 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python-experimental/test/test_child_dog.py index dfb09213e4..5a726e6124 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py index ca75000c65..eec5e35567 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python-experimental/test/test_child_lizard.py index 975dc1612a..0b2bc17c14 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py index 1b3bf4dba9..7f1ae842e6 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-experimental/test/test_class_model.py index 060df39e4b..6dc2a69283 100644 --- a/samples/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/client/petstore/python-experimental/test/test_class_model.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-experimental/test/test_client.py index ab5e3a80d3..caf85a24aa 100644 --- a/samples/client/petstore/python-experimental/test/test_client.py +++ b/samples/client/petstore/python-experimental/test/test_client.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py index 26949b34ae..0bdb477f86 100644 --- a/samples/client/petstore/python-experimental/test/test_dog.py +++ b/samples/client/petstore/python-experimental/test/test_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -86,7 +85,7 @@ class TestDog(unittest.TestCase): with self.assertRaises(AttributeError): invalid_variable = dog['invalid_variable'] # with getattr - self.assertEquals(getattr(dog, 'invalid_variable', 'some value'), 'some value') + self.assertEqual(getattr(dog, 'invalid_variable', 'some value'), 'some value') with self.assertRaises(AttributeError): invalid_variable = getattr(dog, 'invalid_variable') diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_dog_all_of.py index 7ab4e8ae79..9f5075b7ed 100644 --- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py index 64ad5fd7dc..b1d0394df8 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py index f910231c9d..ed19c7985d 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/client/petstore/python-experimental/test/test_enum_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index 7b4c1b6b66..b79127a398 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 2e11cdbc37..6e3c87bc70 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api @@ -46,7 +44,6 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - from petstore_api.model_utils import str endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -112,11 +109,7 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set endpoint = self.api.test_endpoint_enums_length_one - import six - if six.PY3: - from unittest.mock import patch - else: - from mock import patch + from unittest.mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: endpoint() call_with_http_info.assert_called_with( diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index 1ade31405a..b7724aaed7 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import -import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py index 8d60f64e01..438482f395 100644 --- a/samples/client/petstore/python-experimental/test/test_file.py +++ b/samples/client/petstore/python-experimental/test/test_file.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py index 9a4f6d38df..ec38c523c7 100644 --- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index ca37b005fd..ec2c8d0cbe 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python-experimental/test/test_grandparent.py index 2972d01161..bf2455a5ca 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py index cabe4d81f9..42b1f0f716 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py index 9ebd7683b3..c9bf4c2865 100644 --- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-experimental/test/test_list.py index 52156adfed..77611c300d 100644 --- a/samples/client/petstore/python-experimental/test/test_list.py +++ b/samples/client/petstore/python-experimental/test/test_list.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py index 3feda0f688..f905d7e919 100644 --- a/samples/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/client/petstore/python-experimental/test/test_map_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 4dcb5ad426..7de400b004 100644 --- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-experimental/test/test_model200_response.py index 4012eaae33..8ff474d5dd 100644 --- a/samples/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/client/petstore/python-experimental/test/test_model200_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-experimental/test/test_model_return.py index 54c98b33cd..f856d3d762 100644 --- a/samples/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/client/petstore/python-experimental/test/test_model_return.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-experimental/test/test_name.py index 6a9be99d1a..b3841ca030 100644 --- a/samples/client/petstore/python-experimental/test/test_name.py +++ b/samples/client/petstore/python-experimental/test/test_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-experimental/test/test_number_only.py index 07aab1d78a..b7205f5fe0 100644 --- a/samples/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python-experimental/test/test_number_with_validations.py index 3f0b78835d..98dc2930d3 100644 --- a/samples/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index e0a8b84268..cdf42fcd66 100644 --- a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -34,7 +33,7 @@ class TestObjectModelWithRefProps(unittest.TestCase): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import str, number_with_validations + from petstore_api.model.object_model_with_ref_props import number_with_validations self.assertEqual( ObjectModelWithRefProps.openapi_types, { diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py index ee6988e28c..03f633d353 100644 --- a/samples/client/petstore/python-experimental/test/test_order.py +++ b/samples/client/petstore/python-experimental/test/test_order.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python-experimental/test/test_parent.py index 20282dfb41..385c66d2a6 100644 --- a/samples/client/petstore/python-experimental/test/test_parent.py +++ b/samples/client/petstore/python-experimental/test/test_parent.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python-experimental/test/test_parent_all_of.py index ca87189bba..f6485ac3cc 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_parent_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python-experimental/test/test_parent_pet.py index 17a4d60e75..4a69d88eb7 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py index b072cff5e9..9edf385aa2 100644 --- a/samples/client/petstore/python-experimental/test/test_pet.py +++ b/samples/client/petstore/python-experimental/test/test_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-experimental/test/test_pet_api.py index 091b30cf8a..d545f49729 100644 --- a/samples/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/client/petstore/python-experimental/test/test_pet_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import -import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python-experimental/test/test_player.py index ee7b95a677..6dc8137872 100644 --- a/samples/client/petstore/python-experimental/test/test_player.py +++ b/samples/client/petstore/python-experimental/test/test_player.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-experimental/test/test_read_only_first.py index c2dcde240e..a07676e9c2 100644 --- a/samples/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-experimental/test/test_special_model_name.py index 6124525f51..4c525d99be 100644 --- a/samples/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-experimental/test/test_store_api.py index 0d9cc3dd36..3680a34b42 100644 --- a/samples/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/client/petstore/python-experimental/test/test_store_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py index e2e9d8b420..e4e795cca2 100644 --- a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_string_enum.py b/samples/client/petstore/python-experimental/test/test_string_enum.py index 5eed0ad6f0..c7f463c444 100644 --- a/samples/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/client/petstore/python-experimental/test/test_string_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-experimental/test/test_tag.py index 68a3b9046b..0ce1c0a87f 100644 --- a/samples/client/petstore/python-experimental/test/test_tag.py +++ b/samples/client/petstore/python-experimental/test/test_tag.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index f9c050b81a..4a517b305b 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-experimental/test/test_type_holder_example.py index e1ee7c3686..8d3c5c745d 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_example.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-experimental/test/test_user.py index 7241bb589c..df3d2fff65 100644 --- a/samples/client/petstore/python-experimental/test/test_user.py +++ b/samples/client/petstore/python-experimental/test/test_user.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-experimental/test/test_user_api.py index df306da077..abf57b0733 100644 --- a/samples/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/client/petstore/python-experimental/test/test_user_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-experimental/test/test_xml_item.py index 4354664815..04322addc2 100644 --- a/samples/client/petstore/python-experimental/test/test_xml_item.py +++ b/samples/client/petstore/python-experimental/test/test_xml_item.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test_python2_and_3.sh b/samples/client/petstore/python-experimental/test_python.sh similarity index 100% rename from samples/client/petstore/python-experimental/test_python2_and_3.sh rename to samples/client/petstore/python-experimental/test_python.sh diff --git a/samples/client/petstore/python-experimental/test_python2.sh b/samples/client/petstore/python-experimental/test_python2.sh deleted file mode 100644 index 75b9d6798d..0000000000 --- a/samples/client/petstore/python-experimental/test_python2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -PYTHONPATH="$(which python)" - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -e py27 || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi - diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 0d0771b578..3c415e2ad7 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -10,7 +10,6 @@ $ nosetests -v """ import os -import six import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index a3eca81f32..a5b1a66e7a 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -15,8 +15,6 @@ import time import unittest import datetime -import six - import petstore_api from petstore_api.exceptions import ( @@ -38,9 +36,7 @@ from petstore_api.model import ( ) from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) from petstore_api.rest import RESTResponse @@ -381,8 +377,7 @@ class DeserializationTests(unittest.TestCase): file_path = file_object.name self.assertFalse(file_object.closed) file_object.close() - if six.PY3: - file_data = file_data.encode('utf-8') + file_data = file_data.encode('utf-8') with open(file_path, 'rb') as other_file_object: self.assertEqual(other_file_object.read(), file_data) finally: @@ -407,7 +402,7 @@ class DeserializationTests(unittest.TestCase): http_response = HTTPResponse( status=200, reason='OK', - data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), + data=json.dumps(data).encode("utf-8"), getheaders=get_headers, getheader=get_header ) diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 38d7a1cc0b..0a66b49c1d 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -23,8 +23,6 @@ from petstore_api.rest import ( RESTResponse ) -import six - from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -36,10 +34,7 @@ from .util import id_gen import urllib3 -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch HOST = 'http://localhost/v2' diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python-experimental/tests/test_serialization.py index 497c3b6dfc..6f7166ee56 100644 --- a/samples/client/petstore/python-experimental/tests/test_serialization.py +++ b/samples/client/petstore/python-experimental/tests/test_serialization.py @@ -15,8 +15,6 @@ import time import unittest import datetime -import six - import petstore_api from petstore_api.exceptions import ( @@ -37,9 +35,7 @@ from petstore_api.model import ( ) from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) from petstore_api.rest import RESTResponse diff --git a/samples/client/petstore/python-experimental/tox.ini b/samples/client/petstore/python-experimental/tox.ini index 169d895329..8989fc3c4d 100644 --- a/samples/client/petstore/python-experimental/tox.ini +++ b/samples/client/petstore/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml index 475aaf9bb7..c0bcd3bec2 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=x_auth_id_alias -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml index 97a849816e..dbcba3d8b9 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md index 38273d89a1..b70a7bfcb4 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import x_auth_id_alias Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md index bea1ee7ce1..e68aff3cb6 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md @@ -22,7 +22,6 @@ Use any API key * Api Key Authentication (api_key): * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -107,7 +106,6 @@ Use both API keys * Api Key Authentication (api_key): * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -191,7 +189,6 @@ Use API key in header * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -265,7 +262,6 @@ Use API key in query * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt index a56bedffbf..2c2f00fcb2 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py index d266f0ac09..6283d1ff49 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py @@ -23,12 +23,10 @@ VERSION = "1.0.0" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ setup( author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension x-auth-id-alias"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt index 06f7754d20..2d88b03419 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py index f7d98a751b..db5d36ec62 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py index 4852fd4b91..61b723478b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py @@ -4,8 +4,6 @@ Test usage of x-auth-id-alias. """ -from __future__ import absolute_import - import unittest import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini index 1eebd7b9dd..64885ad1bb 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py index 7b41721baa..2003cfda7c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py index 37e0c5bbdb..1d37d33951 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from x_auth_id_alias.api.usage_api import UsageApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py index 454eefd6b3..d7f0428a38 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from x_auth_id_alias.api_client import ApiClient, Endpoint from x_auth_id_alias.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from x_auth_id_alias.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py index d2559726f6..be9cef4ff3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from x_auth_id_alias import rest from x_auth_id_alias.configuration import Configuration @@ -34,10 +31,8 @@ from x_auth_id_alias.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ class ApiClient(object): return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py index 278f7aa13d..5852bbc6b5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from x_auth_id_alias.exceptions import ApiValueError @@ -288,7 +285,7 @@ conf = x_auth_id_alias.Configuration( # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -310,17 +307,17 @@ conf = x_auth_id_alias.Configuration( self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py index 13f8852a90..28e4253a0a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py index fb4fc073bd..4bbe813f36 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from x_auth_id_alias.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ from x_auth_id_alias.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ class ModelSimple(OpenApiModel): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ class ModelNormal(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ class ModelComposed(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py index 354091c3a9..2042ee8caa 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from x_auth_id_alias.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml index b242dc3751..c568a94e1d 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=dynamic_servers -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml index e6f2ea657f..830b855ce6 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md index 81db8a329f..f85d06bd96 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import dynamic_servers Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import dynamic_servers diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md b/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md index 3c4ed134c5..ab21766aba 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md @@ -18,7 +18,6 @@ Use custom server ### Example ```python -from __future__ import print_function import time import dynamic_servers from dynamic_servers.api import usage_api @@ -77,7 +76,6 @@ Use default server ### Example ```python -from __future__ import print_function import time import dynamic_servers from dynamic_servers.api import usage_api diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py index e42afd4939..b7f955894f 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py index e4e46e3843..1d37d33951 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from dynamic_servers.api.usage_api import UsageApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py index d73b46b4eb..6415fe505d 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from dynamic_servers.api_client import ApiClient, Endpoint from dynamic_servers.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from dynamic_servers.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py index ca8d70ce9a..cbbaa8c0b2 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from dynamic_servers import rest from dynamic_servers.configuration import Configuration @@ -34,10 +31,8 @@ from dynamic_servers.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ class ApiClient(object): return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py index 8ece9e3c13..3bdb2bf696 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from dynamic_servers.exceptions import ApiValueError @@ -268,7 +265,7 @@ class Configuration(object): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -290,17 +287,17 @@ class Configuration(object): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py index 8cafe7240c..a463fd1017 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py index 17527b879b..c35b5a8531 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from dynamic_servers.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ from dynamic_servers.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ class ModelSimple(OpenApiModel): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ class ModelNormal(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ class ModelComposed(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py index e9bd23610f..efe36544bf 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from dynamic_servers.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt b/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt index a56bedffbf..2c2f00fcb2 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py index 5da7badc97..e14ab67ede 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py @@ -23,12 +23,10 @@ VERSION = "1.0.0" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ setup( author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension with dynamic servers"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt b/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt index 06f7754d20..2d88b03419 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py index faffb9263d..9bca5cafb0 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import - import functools import unittest diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini b/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini index 85712433c5..c27e7fe327 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml index 142ce3712e..9703213bb0 100644 --- a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml index fcd7e31c7c..3aa7c047e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/.travis.yml +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile index 9354f43d50..f8957d5ed6 100644 --- a/samples/openapi3/client/petstore/python-experimental/Makefile +++ b/samples/openapi3/client/petstore/python-experimental/Makefile @@ -13,7 +13,4 @@ clean: find . -name "__pycache__" -delete test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh + bash ./test_python.sh diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 2928746333..c1f2770b3c 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import petstore_api Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import datetime import time import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index 4290afb9ab..b4f0834b12 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -17,7 +17,6 @@ To test special tags and operation ID starting with number ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import another_fake_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index d5e28c8bc4..45617a26a7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -15,7 +15,6 @@ Method | HTTP request | Description ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import default_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index 4ac7298073..a9a8e6ca11 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -33,7 +33,6 @@ Additional Properties with Array of Enums ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -98,7 +97,6 @@ Test serialization of ArrayModel ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -160,7 +158,6 @@ Array of Enums ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -225,7 +222,6 @@ Test serialization of outer boolean types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -288,7 +284,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -350,7 +345,6 @@ Health check endpoint ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -410,7 +404,6 @@ Test serialization of outer number types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -474,7 +467,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -538,7 +530,6 @@ Test serialization of outer string types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -601,7 +592,6 @@ Test serialization of outer enum ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -665,7 +655,6 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -725,7 +714,6 @@ No authorization required ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -789,7 +777,6 @@ To test \"client\" model ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -854,7 +841,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * Basic Authentication (http_basic_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -961,7 +947,6 @@ To test enum parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1040,7 +1025,6 @@ Fake endpoint to test group parameters (optional) * Bearer (JWT) Authentication (bearer_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1127,7 +1111,6 @@ test inline additionalProperties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1187,7 +1170,6 @@ test json serialization of form data ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1251,7 +1233,6 @@ To test the collection format in query parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 3568b3be23..713737dfb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -18,7 +18,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_classname_tags_123_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index a5344a30f1..a29af68a4c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -24,7 +24,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -156,7 +155,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -239,7 +237,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -375,7 +372,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -511,7 +507,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -590,7 +585,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -724,7 +718,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -807,7 +800,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -893,7 +885,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index 2cebd103e1..cb973190ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -20,7 +20,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -84,7 +83,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -157,7 +155,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -221,7 +218,6 @@ Place an order for a pet ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index ffcdef6d34..435713374e 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -24,7 +24,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -85,7 +84,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -146,7 +144,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -209,7 +206,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -270,7 +266,6 @@ Get user by user name ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -334,7 +329,6 @@ Logs user into the system ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -398,7 +392,6 @@ Logs out current logged in user session ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -456,7 +449,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index fb7630e30d..db9beb2ebf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py index fa4e54a800..1d37d33951 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -1,12 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index c723d80c54..40ca75cb25 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index c3fcc91e77..c6bf00fdc4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import inline_response_default diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index fb29276f75..b294bfc8e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import additional_properties_with_array_of_enums diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 4e6e9b4f0f..067e5a91f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 1c13ec171a..0a018863df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index 075a17d464..9c608eb313 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index 96540433ae..5e3276985d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import user diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index 9f3a16a669..e31d5c5e4a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration @@ -34,10 +31,8 @@ from petstore_api.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ class ApiClient(object): return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -678,7 +671,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -700,7 +693,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -758,7 +751,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index 4aca424272..14beaba906 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from petstore_api.exceptions import ApiValueError @@ -358,7 +355,7 @@ conf = petstore_api.Configuration( # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -380,17 +377,17 @@ conf = petstore_api.Configuration( self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py index b55977ee5e..fecd2081b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index c48b515a7a..bc7591c4eb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -184,7 +180,7 @@ class AdditionalPropertiesClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 09c35b5d0d..006e258d72 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -165,7 +161,7 @@ class AdditionalPropertiesWithArrayOfEnums(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index a71502767a..7c16f2ba3b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ class Address(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 7ba62dad16..7f1257e2ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -185,7 +181,7 @@ class Animal(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 4030d038ed..94d6d094d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index c921519b87..24a2e3d897 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class ApiResponse(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index 3f87c152e3..a87374c440 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -177,7 +173,7 @@ class Apple(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 66b2899dbf..16ef4bcac8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class AppleReq(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.cultivar = cultivar - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index b9f52d6ba7..014740ca0a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 7e1428454e..dbde502ccd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 45021fef4c..00afce1fb4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ArrayOfNumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index e2bc76832b..e4478c5acd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class ArrayTest(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 6e42bcb572..13725068e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class Banana(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 3128a03805..2675290a9c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class BananaReq(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.length_cm = length_cm - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index cf39c1833d..2766647c86 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class BasquePig(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 06745009d8..18c5f54c06 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -178,7 +174,7 @@ class Capitalization(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index ab01b1f0a9..3296635927 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -218,7 +214,7 @@ class Cat(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 49ae9462f4..c257813c12 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class CatAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index 16e4a33d4f..e2be1802b1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ class Category(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 996f3e0098..0710d1523d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ class ChildCat(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 1ddf92fb12..cc67b70c87 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ChildCatAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index fc88f68e3f..d80e4ef367 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ClassModel(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index fa99b07fa3..2ea3b4aadd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class Client(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 7cc5a70032..768104df4c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class ComplexQuadrilateral(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py index 22ca4a480a..b513cd1039 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class ComposedOneOfNumberWithValidations(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 375fde3258..768a47bdc7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class DanishPig(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index a100eb3c70..836d19b484 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ class Dog(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 0d053aca2a..299a4d956b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class DogAllOf(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index 8d61b20887..ea6422a102 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -192,7 +188,7 @@ class Drawing(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index a199904497..161ddd5c1d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ class EnumArrays(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 7c5014fd53..dac3ee37d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 722906fbf9..120cb1b3da 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -233,7 +229,7 @@ class EnumTest(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.enum_string_required = enum_string_required - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 44f69a5dce..e3a3507fa7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class EquilateralTriangle(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index 0152f8d8c6..f7cdcb4fdf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class File(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 0a9471e9e4..3c1d880d35 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -171,7 +167,7 @@ class FileSchemaTestClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 34b9eb6fba..5bb23de078 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class Foo(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 6c5ae81e7d..929b5abb69 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -254,7 +250,7 @@ class FormatTest(ModelNormal): self.byte = byte self.date = date self.password = password - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 244497b64a..61f95c056a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ class Fruit(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 11a7615749..88ace981c6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -215,7 +211,7 @@ class FruitReq(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index e2ebe6fd9d..9e063a0290 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ class GmFruit(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index b5af666f75..3f847bc715 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -182,7 +178,7 @@ class GrandparentAnimal(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.pet_type = pet_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index eeb685139c..7a722ee9c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class HasOnlyReadOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index be6cfa1c0a..4c56f50224 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class HealthCheckResult(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py index 8975f4be51..062e583201 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class InlineObject(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py index 4991e89953..7cfd107cc1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class InlineObject1(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py index 5b41402703..adde4e38e9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ class InlineObject2(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py index 01c49c375e..1cadbd0578 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -242,7 +238,7 @@ class InlineObject3(ModelNormal): self.double = double self.pattern_without_delimiter = pattern_without_delimiter self.byte = byte - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py index a45a324fb5..1625fed114 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ class InlineObject4(ModelNormal): self.param = param self.param2 = param2 - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py index 23e0819583..57d0e6f2c8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ class InlineObject5(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.required_file = required_file - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index f3abf4a7a1..a80abc3897 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -168,7 +164,7 @@ class InlineResponseDefault(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 2a47792756..9f68ce79be 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index 0b28c34c3a..ee0ef6db55 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index e32d50e3f0..73211d171c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index 40c8878bb0..a608fe9b72 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class IsoscelesTriangle(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py index 9499f26c7b..77bd4d0565 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class List(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index e0b9f31408..f6c274287f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -229,7 +225,7 @@ class Mammal(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index a22af06ce4..5bafea48a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -181,7 +177,7 @@ class MapTest(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index a0fcac2eb0..12cda6cf9a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index 54cc1fa338..ea4df21be4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class Model200Response(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index cf7415f0bd..535657ebbc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class ModelReturn(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 33a95baafc..95f197a7a5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ class Name(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index c16714bd32..878266d85d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -196,7 +192,7 @@ class NullableClass(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 77778126a6..a2979d1b67 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ class NullableShape(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index 305da1d753..d16ea3765f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class NumberOnly(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index b860a7848d..dcd182e340 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index f76243bc36..15ccc61db3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ class ObjectModelWithRefProps(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index ddc3332d66..b21543df95 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -183,7 +179,7 @@ class Order(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 26a44926fa..f8faa308d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -208,7 +204,7 @@ class ParentPet(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 742d7cdf04..5837810f22 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -197,7 +193,7 @@ class Pet(ModelNormal): self.name = name self.photo_urls = photo_urls - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 2e02e4e88c..f64d88bfeb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -209,7 +205,7 @@ class Pig(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index b0766c9871..ca871a544f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -214,7 +210,7 @@ class Quadrilateral(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index 05e4d0f3b1..e76a7e0a9c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class QuadrilateralInterface(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.quadrilateral_type = quadrilateral_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 691d789a92..b53aa4db39 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class ReadOnlyFirst(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 2c58f1bb99..55defdec48 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class ScaleneTriangle(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 9eec4b7705..457d5743b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ class Shape(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py index 1f3d518ba3..1db0ffe70c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class ShapeInterface(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.shape_type = shape_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 8c00f44dfa..17027a5bc5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ class ShapeOrNull(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index dd27bd66fe..330cb84581 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ class SimpleQuadrilateral(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 6e2b80cbe9..75df4a577a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ class SpecialModelName(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 8351ad04e2..b1fb643211 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ class StringBooleanMap(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index d34bccbc59..3de705cdcc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index f02facca01..1598bc6843 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index aa50402b7f..cdf9c9d263 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class Tag(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index 52c3218db1..b08f0d1025 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ class Triangle(ModelComposed): for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index 56d960a133..5b3ff330c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ class TriangleInterface(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.triangle_type = triangle_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index 836e7f9c0b..6813e0eb09 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -196,7 +192,7 @@ class User(ModelNormal): self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index eb066c53be..586c6efa02 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -172,7 +168,7 @@ class Whale(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index e4c2b8d422..c90032e767 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ from petstore_api.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ class Zebra(ModelNormal): self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index f15303a094..ff378aa1e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from petstore_api.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ from petstore_api.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ class ModelSimple(OpenApiModel): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ class ModelNormal(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ class ModelComposed(OpenApiModel): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py index 973161ca7a..fb424024af 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from petstore_api.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index 0c361e5ed4..85fd1506a7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import from base64 import b64encode from Crypto.IO import PEM, PKCS8 @@ -19,8 +18,8 @@ from email.utils import formatdate import json import os import re -from six.moves.urllib.parse import urlencode, urlparse from time import time +from urllib.parse import urlencode, urlparse # The constants below define a subset of HTTP headers that can be included in the # HTTP signature scheme. Additional headers may be included in the signature. diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-experimental/pom.xml index 2016c019a9..c2364c7448 100644 --- a/samples/openapi3/client/petstore/python-experimental/pom.xml +++ b/samples/openapi3/client/petstore/python-experimental/pom.xml @@ -35,7 +35,7 @@ make - test-all + test diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt index a56bedffbf..2c2f00fcb2 100644 --- a/samples/openapi3/client/petstore/python-experimental/requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index 261bc12d34..2aa2823003 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -23,14 +23,12 @@ VERSION = "1.0.0" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", "pem>=19.3.0", "pycryptodome>=3.9.0", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -40,8 +38,8 @@ setup( author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt index bf6f7a1997..36d9b4fa7a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -1,5 +1,4 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 +pytest-randomly==1.2.3 # needed for python 3.4 pycryptodome>=3.9.0 -mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py index befc14455d..42fdf19487 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py index 5497740721..f3a248e0da 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py @@ -10,11 +10,15 @@ """ -from __future__ import absolute_import import sys import unittest import petstore_api +try: + from petstore_api.model import enum_class +except ImportError: + enum_class = sys.modules[ + 'petstore_api.model.enum_class'] from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_address.py b/samples/openapi3/client/petstore/python-experimental/test/test_address.py index dcc33c22db..7afbdc4cd4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_address.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_address.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py index 958f303f13..0e1f850737 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py index 7117d42b43..f473c465d7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py index f79966a269..c58dfa6202 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py index 9db92633f6..a9a900c29c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py index 9aedfc0b01..d26e075416 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py index 79650cd1c7..e4cc66efc2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 4980ad17af..39f8874a4e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py index 8f0fbf1844..6d28903bf7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py index 479c537cad..c4abfd0686 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py index 2426b27b7e..f966f4c0d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py index a989386b01..69b7704bc2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py index 39d125e4a1..2f1d5a8ae3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py index b00c5f8a6a..897a69bb81 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py index 20d2649c01..5f47ddb4db 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py index 1cb6b58cbd..8990ae4457 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py index a5bb91ac86..3d5a33d990 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py index 59b64e5924..29490e0dbd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py index 34c085515a..ba3c16543d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a7aab100f..2a0b6b8c22 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py index 060df39e4b..6dc2a69283 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py index ab5e3a80d3..caf85a24aa 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py index 0c0887509c..8fb2a290d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py index 28df8eae3e..dde9907697 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py index a82c352e84..dadbf7f661 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py index 5f4fb5230a..caf174d6d4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py index 4a6fc61ad7..32633cce7c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py index 7ab4e8ae79..9f5075b7ed 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py index c70267b137..327e01fb84 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -114,11 +113,11 @@ class TestDrawing(unittest.TestCase): # Validate we cannot assign the None value to main_shape because the 'null' type # is not one of the allowed types in the 'Shape' schema. - err_msg = ("Invalid type for variable '{}'. " - "Required value type is {} and passed type was {} at {}") - with self.assertRaisesRegexp( + err_msg = (r"Invalid type for variable '{}'. " + r"Required value type is {} and passed type was {} at {}") + with self.assertRaisesRegex( petstore_api.ApiTypeError, - err_msg.format("main_shape", "one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", "NoneType", "\['main_shape'\]") + err_msg.format(r"main_shape", r"one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", r"NoneType", r"\['main_shape'\]") ): inst = Drawing( # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py index 143a23fe0d..9458d918a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py index f910231c9d..ed19c7985d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py index d442443504..88190693a3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py index 8f286edfdc..f611501c44 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index 4b165e8c86..8b89752b36 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -9,17 +9,10 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import - from collections import namedtuple import unittest import json - -import six -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 @@ -214,7 +207,6 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - from petstore_api.model_utils import str endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index c12e35eb5d..b7724aaed7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py index 8d60f64e01..438482f395 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py index 9a4f6d38df..ec38c523c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py index 8125de84ad..648a84c66f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py index 07f4f5e4c1..a5441cec1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py index 1eb9d09d50..fac0319663 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py index c161570df0..3e637c3226 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py index 9d13e90659..85d0fcf9b1 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py index 286ef17657..517ccf3114 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py index 9ebd7683b3..c9bf4c2865 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py index 11ff5f5cf6..35f4d3afa9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py index 3b3eee8080..3e391022d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py index 77d4b46553..982e20e0c6 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py index b2310f1521..133e31acb2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py index afe7ca4342..69bf17c56c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py index 1b9bea4716..727596be5e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py index ac72c53c1e..1ef579b8e3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py index b52167aea1..74ab5c2be3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py index 25667e2a8d..34a2dada39 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py index 7ad6dc5f08..eff7298d9f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py index 0a83cb2f3f..e752553195 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py index d89ae6ab78..e4fe2ccbd7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py index 52156adfed..77611c300d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_list.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py index 2a8893d02f..3ed00dd798 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py index 88b28ff93d..f588781f13 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 4dcb5ad426..7de400b004 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py index 4012eaae33..8ff474d5dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py index 54c98b33cd..f856d3d762 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py index 6a9be99d1a..b3841ca030 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py index f73dc3d98b..730e9264ef 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py index d6bf001743..32721b0088 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py index 07aab1d78a..b7205f5fe0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py index b48904c59c..f4264ca82e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index e0a8b84268..cdf42fcd66 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -34,7 +33,7 @@ class TestObjectModelWithRefProps(unittest.TestCase): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import str, number_with_validations + from petstore_api.model.object_model_with_ref_props import number_with_validations self.assertEqual( ObjectModelWithRefProps.openapi_types, { diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py index 604c67042c..fd420b846a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py index 15262872e1..a57f9b8527 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py index fb8586e409..6d03ce5bb3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py index 3f2d3a8847..d545f49729 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py index f98bed3f19..bb3a6bdfa8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py index 149b9a0070..63f74ae541 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py index 0b2e32dc37..2dee368036 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py index c2dcde240e..a07676e9c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py index f5f1ccb3ef..d6fb13eb6c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py index 4424679aec..d4240f6953 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -78,7 +77,7 @@ class TestShape(unittest.TestCase): err_msg = ("Cannot deserialize input data due to missing discriminator. " "The discriminator property '{}' is missing at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("shapeType") ): @@ -89,14 +88,14 @@ class TestShape(unittest.TestCase): "value. The OpenAPI document has no mapping for discriminator " "property '{}'='{}' at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("shapeType", "Circle") ): Shape(shape_type="Circle") # invalid quadrilateral_type (second discriminator) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("quadrilateralType", "Triangle") ): diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py index c8b0270f9f..9108ad8673 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py index e3bfa41e7e..7dc0988173 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py index b08ddf1c67..4b5e8bbedf 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py index 6124525f51..4c525d99be 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py index 0d9cc3dd36..3680a34b42 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py index e2e9d8b420..e4e795cca2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py index 3a2c316a07..a9f7431e24 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py index fbf963edfa..2a83ea5ba9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py index b0a09d94a7..0ce1c0a87f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -10,8 +10,7 @@ """ -from __future__ import absolute_import - +import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py index 65ae20743e..7268022cad 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py index e087651a7d..6e88d29b7c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py index 7241bb589c..df3d2fff65 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py index df306da077..abf57b0733 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py index 3ad793af3e..d057053203 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py index fe3245cced..affb41e5cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-experimental/test_python.sh similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh rename to samples/openapi3/client/petstore/python-experimental/test_python.sh diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2.sh b/samples/openapi3/client/petstore/python-experimental/test_python2.sh deleted file mode 100755 index 75b9d6798d..0000000000 --- a/samples/openapi3/client/petstore/python-experimental/test_python2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -PYTHONPATH="$(which python)" - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -e py27 || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi - diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py index ec30635b07..37e0943273 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py @@ -78,7 +78,7 @@ class DeserializationTests(unittest.TestCase): "value. The OpenAPI document has no mapping for discriminator " "property '{}'='{}' at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("quadrilateralType", "Triangle") ): @@ -125,7 +125,7 @@ class DeserializationTests(unittest.TestCase): # Test with invalid regex pattern. err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("cultivar", "[^`]*") ): @@ -134,7 +134,7 @@ class DeserializationTests(unittest.TestCase): ) err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("origin", "[^`]*") ): @@ -262,7 +262,7 @@ class DeserializationTests(unittest.TestCase): # The 'bananaReq' schema disallows additional properties by explicitly setting # additionalProperties: false err_msg = ("{} has no attribute '{}' at ") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.exceptions.ApiAttributeError, err_msg.format("BananaReq", "unknown-group") ): diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py index 976a3da2df..d8b71e4435 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py @@ -21,9 +21,7 @@ from petstore_api import Configuration, signing from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) MockResponse = namedtuple('MockResponse', 'data') diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 2e3227f70d..c6854d666c 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -19,10 +19,11 @@ import os import re import shutil import unittest +from urllib.parse import urlencode, urlparse + from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import ECC, RSA from Crypto.Signature import pkcs1_15, pss, DSS -from six.moves.urllib.parse import urlencode, urlparse import petstore_api from petstore_api.model import category, tag, pet @@ -33,8 +34,6 @@ from petstore_api.rest import ( RESTResponse ) -import six - from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -45,10 +44,7 @@ from .util import id_gen import urllib3 -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch HOST = 'http://localhost/v2' diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini index 169d895329..8989fc3c4d 100644 --- a/samples/openapi3/client/petstore/python-experimental/tox.ini +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt