diff --git a/.github/workflows/test_outdated_versions.yml b/.github/workflows/test_outdated_versions.yml index 6bf4d54313aa..e5959dac68f2 100644 --- a/.github/workflows/test_outdated_versions.yml +++ b/.github/workflows/test_outdated_versions.yml @@ -16,7 +16,7 @@ jobs: python-version: [ "3.11" ] responses-version: ["0.13.0", "0.15.0", "0.17.0", "0.19.0", "0.20.0" ] werkzeug-version: ["2.0.1", "2.1.1", "2.2.2"] - openapi-spec-validator-version: ["0.4.0", "0.5.0"] + openapi-spec-validator-version: ["0.5.0"] steps: - name: Checkout repository diff --git a/moto/apigateway/models.py b/moto/apigateway/models.py index 7e90765a2e9f..30d109da524d 100644 --- a/moto/apigateway/models.py +++ b/moto/apigateway/models.py @@ -6,15 +6,11 @@ from typing import Any, Dict, List, Optional, Tuple, Union from urllib.parse import urlparse -from openapi_spec_validator import validate_spec import requests import responses -try: - from openapi_spec_validator.validation.exceptions import OpenAPIValidationError -except ImportError: - # OpenAPI Spec Validator < 0.5.0 - from openapi_spec_validator.exceptions import OpenAPIValidationError # type: ignore +from openapi_spec_validator import validate_spec +from openapi_spec_validator.validation.exceptions import OpenAPIValidationError from moto.core import BaseBackend, BackendDict, BaseModel, CloudFormationModel from .utils import create_id, to_path from moto.core.utils import path_url diff --git a/requirements-tests.txt b/requirements-tests.txt index 70a535e4844c..a84560db474f 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,7 +1,7 @@ coverage pytest pytest-cov -pytest-ordering +pytest-order pytest-xdist freezegun pylint diff --git a/setup.cfg b/setup.cfg index c49febb48aec..6dc3286068df 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,7 +49,7 @@ all = PyYAML>=5.1 cfn-lint>=0.40.0 sshpubkeys>=3.1.0 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 py-partiql-parser==0.4.1 @@ -64,7 +64,7 @@ proxy = PyYAML>=5.1 cfn-lint>=0.40.0 sshpubkeys>=3.1.0 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 py-partiql-parser==0.4.1 @@ -79,7 +79,7 @@ server = PyYAML>=5.1 cfn-lint>=0.40.0 sshpubkeys>=3.1.0 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 py-partiql-parser==0.4.1 @@ -94,7 +94,7 @@ apigateway = PyYAML>=5.1 python-jose[cryptography]>=3.1.0,<4.0.0 ecdsa!=0.15 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 apigatewayv2 = PyYAML>=5.1 applicationautoscaling = appsync = graphql-core @@ -113,7 +113,7 @@ cloudformation = PyYAML>=5.1 cfn-lint>=0.40.0 sshpubkeys>=3.1.0 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 py-partiql-parser==0.4.1 @@ -202,7 +202,7 @@ resourcegroupstaggingapi = PyYAML>=5.1 cfn-lint>=0.40.0 sshpubkeys>=3.1.0 - openapi-spec-validator>=0.2.8 + openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 py-partiql-parser==0.4.1