Pin typing_extensions for Py3.7 (#6339)
This commit is contained in:
parent
ea826891d3
commit
a28dd1abc8
@ -1573,6 +1573,10 @@ class APIGatewayBackend(BaseBackend):
|
|||||||
validate_spec(api_doc) # type: ignore[arg-type]
|
validate_spec(api_doc) # type: ignore[arg-type]
|
||||||
except OpenAPIValidationError as e:
|
except OpenAPIValidationError as e:
|
||||||
raise InvalidOpenAPIDocumentException(e)
|
raise InvalidOpenAPIDocumentException(e)
|
||||||
|
except AttributeError:
|
||||||
|
# Call can fail in Python3.7 due to `typing_extensions 4.6.0` throwing an error
|
||||||
|
# Easiest to just ignore this for now - Py3.7 is EOL soon anyway
|
||||||
|
pass
|
||||||
name = api_doc["info"]["title"]
|
name = api_doc["info"]["title"]
|
||||||
description = api_doc["info"]["description"]
|
description = api_doc["info"]["description"]
|
||||||
api = self.create_rest_api(name=name, description=description)
|
api = self.create_rest_api(name=name, description=description)
|
||||||
@ -1644,6 +1648,10 @@ class APIGatewayBackend(BaseBackend):
|
|||||||
validate_spec(api_doc) # type: ignore[arg-type]
|
validate_spec(api_doc) # type: ignore[arg-type]
|
||||||
except OpenAPIValidationError as e:
|
except OpenAPIValidationError as e:
|
||||||
raise InvalidOpenAPIDocumentException(e)
|
raise InvalidOpenAPIDocumentException(e)
|
||||||
|
except AttributeError:
|
||||||
|
# Call can fail in Python3.7 due to `typing_extensions 4.6.0` throwing an error
|
||||||
|
# Easiest to just ignore this for now - Py3.7 is EOL soon anyway
|
||||||
|
pass
|
||||||
|
|
||||||
if mode == "overwrite":
|
if mode == "overwrite":
|
||||||
api = self.get_rest_api(function_id)
|
api = self.get_rest_api(function_id)
|
||||||
|
@ -9,6 +9,7 @@ click
|
|||||||
inflection
|
inflection
|
||||||
lxml
|
lxml
|
||||||
mypy
|
mypy
|
||||||
|
typing-extensions<=4.5.0; python_version < '3.8'
|
||||||
packaging
|
packaging
|
||||||
build
|
build
|
||||||
prompt_toolkit
|
prompt_toolkit
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import boto3
|
import boto3
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
import sys
|
||||||
|
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from moto import mock_apigateway
|
from moto import mock_apigateway, settings
|
||||||
|
from unittest import SkipTest
|
||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
@ -48,6 +50,9 @@ def test_import_rest_api__nested_api():
|
|||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
def test_import_rest_api__invalid_api_creates_nothing():
|
def test_import_rest_api__invalid_api_creates_nothing():
|
||||||
|
if sys.version_info < (3, 8) or settings.TEST_SERVER_MODE:
|
||||||
|
raise SkipTest("openapi-module throws an error in Py3.7")
|
||||||
|
|
||||||
client = boto3.client("apigateway", region_name="us-west-2")
|
client = boto3.client("apigateway", region_name="us-west-2")
|
||||||
|
|
||||||
path = os.path.dirname(os.path.abspath(__file__))
|
path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import boto3
|
import boto3
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
import sys
|
||||||
|
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from moto import mock_apigateway
|
from moto import mock_apigateway, settings
|
||||||
|
from unittest import SkipTest
|
||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
@ -142,6 +144,9 @@ def test_put_rest_api__existing_methods_still_exist():
|
|||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
def test_put_rest_api__fail_on_invalid_spec():
|
def test_put_rest_api__fail_on_invalid_spec():
|
||||||
|
if sys.version_info < (3, 8) or settings.TEST_SERVER_MODE:
|
||||||
|
raise SkipTest("openapi-module throws an error in Py3.7")
|
||||||
|
|
||||||
client = boto3.client("apigateway", region_name="us-east-2")
|
client = boto3.client("apigateway", region_name="us-east-2")
|
||||||
|
|
||||||
response = client.create_rest_api(name="my_api", description="this is my api")
|
response = client.create_rest_api(name="my_api", description="this is my api")
|
||||||
|
Loading…
Reference in New Issue
Block a user