Skip to content

Commit 71be313

Browse files
authored
Merge pull request #595 from python-openapi/feature/drop-python-37-support
Drop python 3.7 support
2 parents eaa0947 + 3fbfdf5 commit 71be313

File tree

13 files changed

+21
-170
lines changed

13 files changed

+21
-170
lines changed

.github/workflows/python-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
17+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v2
@@ -58,7 +58,6 @@ jobs:
5858

5959
- name: Check dependencies
6060
run: poetry run deptry .
61-
if: ${{ matrix.python-version != '3.7' }}
6261

6362
- name: Upload coverage
6463
uses: codecov/codecov-action@v1

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: python
22
sudo: false
33
matrix:
44
include:
5-
- python: 3.7
65
- python: 3.8
76
- python: 3.9
87
- python: 3.10

openapi_core/contrib/requests/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import sys
2-
3-
if sys.version_info >= (3, 8):
4-
from typing import Protocol
5-
from typing import runtime_checkable
6-
else:
7-
from typing_extensions import Protocol
8-
from typing_extensions import runtime_checkable
1+
from typing import Protocol
2+
from typing import runtime_checkable
93

104
from requests.cookies import RequestsCookieJar
115

openapi_core/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
"""OpenAPI core protocols module"""
2-
import sys
32
from typing import Any
43
from typing import Mapping
54
from typing import Optional
6-
7-
if sys.version_info >= (3, 8):
8-
from typing import Protocol
9-
from typing import runtime_checkable
10-
else:
11-
from typing_extensions import Protocol
12-
from typing_extensions import runtime_checkable
5+
from typing import Protocol
6+
from typing import runtime_checkable
137

148
from openapi_core.datatypes import RequestParameters
159

openapi_core/schema/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
import sys
21
from typing import Any
32
from typing import List
4-
5-
if sys.version_info >= (3, 8):
6-
from typing import Protocol
7-
from typing import runtime_checkable
8-
else:
9-
from typing_extensions import Protocol
10-
from typing_extensions import runtime_checkable
3+
from typing import Protocol
4+
from typing import runtime_checkable
115

126

137
@runtime_checkable

openapi_core/unmarshalling/request/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
"""OpenAPI core validation request protocols module"""
2-
import sys
32
from typing import Optional
4-
5-
if sys.version_info >= (3, 8):
6-
from typing import Protocol
7-
from typing import runtime_checkable
8-
else:
9-
from typing_extensions import Protocol
10-
from typing_extensions import runtime_checkable
3+
from typing import Protocol
4+
from typing import runtime_checkable
115

126
from openapi_core.protocols import Request
137
from openapi_core.protocols import WebhookRequest

openapi_core/unmarshalling/response/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
"""OpenAPI core validation response protocols module"""
2-
import sys
32
from typing import Any
43
from typing import Mapping
54
from typing import Optional
6-
7-
if sys.version_info >= (3, 8):
8-
from typing import Protocol
9-
from typing import runtime_checkable
10-
else:
11-
from typing_extensions import Protocol
12-
from typing_extensions import runtime_checkable
5+
from typing import Protocol
6+
from typing import runtime_checkable
137

148
from openapi_core.protocols import Request
159
from openapi_core.protocols import Response

openapi_core/validation/request/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
"""OpenAPI core validation request protocols module"""
2-
import sys
32
from typing import Iterator
43
from typing import Optional
5-
6-
if sys.version_info >= (3, 8):
7-
from typing import Protocol
8-
from typing import runtime_checkable
9-
else:
10-
from typing_extensions import Protocol
11-
from typing_extensions import runtime_checkable
4+
from typing import Protocol
5+
from typing import runtime_checkable
126

137
from openapi_core.protocols import Request
148
from openapi_core.protocols import WebhookRequest

openapi_core/validation/response/protocols.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
"""OpenAPI core validation response protocols module"""
2-
import sys
32
from typing import Iterator
43
from typing import Optional
5-
6-
if sys.version_info >= (3, 8):
7-
from typing import Protocol
8-
from typing import runtime_checkable
9-
else:
10-
from typing_extensions import Protocol
11-
from typing_extensions import runtime_checkable
4+
from typing import Protocol
5+
from typing import runtime_checkable
126

137
from openapi_core.protocols import Request
148
from openapi_core.protocols import Response

openapi_core/validation/schemas/validators.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
import sys
2+
from functools import cached_property
33
from functools import partial
44
from typing import Any
55
from typing import Iterator
@@ -8,11 +8,6 @@
88
from jsonschema.exceptions import FormatError
99
from jsonschema.protocols import Validator
1010

11-
if sys.version_info >= (3, 8):
12-
from functools import cached_property
13-
else:
14-
from backports.cached_property import cached_property
15-
1611
from openapi_core.spec import Spec
1712
from openapi_core.validation.schemas.datatypes import FormatValidator
1813
from openapi_core.validation.schemas.exceptions import InvalidSchemaValue

openapi_core/validation/validators.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
"""OpenAPI core validation validators module"""
2-
import sys
2+
from functools import cached_property
33
from typing import Any
44
from typing import Mapping
55
from typing import Optional
66
from typing import Tuple
77
from urllib.parse import urljoin
88

9-
if sys.version_info >= (3, 8):
10-
from functools import cached_property
11-
else:
12-
from backports.cached_property import cached_property
139
from openapi_core.casting.schemas import schema_casters_factory
1410
from openapi_core.casting.schemas.factories import SchemaCastersFactory
1511
from openapi_core.deserializing.media_types import (

0 commit comments

Comments
 (0)