Skip to content

Commit 6b796ae

Browse files
committed
Python2 support drop
1 parent 23a8b57 commit 6b796ae

39 files changed

+112
-167
lines changed

.github/workflows/python-publish.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ on:
1212
jobs:
1313
publish:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
python-version: [2.7, 3.6]
1815
steps:
1916
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
17+
- name: Set up Python
2118
uses: actions/setup-python@v2
2219
with:
23-
python-version: ${{ matrix.python-version }}
20+
python-version: '3.x'
2421
- name: Install dependencies
2522
run: |
2623
python -m pip install --upgrade pip

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
16+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
1717
fail-fast: false
1818
steps:
1919
- uses: actions/checkout@v2

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: python
22
sudo: false
33
matrix:
44
include:
5-
- python: 2.7
65
- python: 3.5
76
- python: 3.6
87
- python: 3.7

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ include LICENSE
22
include README.rst
33
include requirements.txt
44
include requirements_dev.txt
5-
include requirements_2.7.txt
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""OpenAPI core casting schemas util module"""
22
from distutils.util import strtobool
3-
from six import string_types
43

54

65
def forcebool(val):
7-
if isinstance(val, string_types):
6+
if isinstance(val, str):
87
val = strtobool(val)
98

109
return bool(val)

openapi_core/compat.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

openapi_core/contrib/django/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""OpenAPI core contrib django requests module"""
22
import re
33

4-
from six.moves.urllib.parse import urljoin
4+
from urllib.parse import urljoin
55

66
from openapi_core.contrib.django.compat import (
77
get_request_headers, get_current_scheme_host,

openapi_core/contrib/flask/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""OpenAPI core contrib flask requests module"""
22
import re
33

4-
from six.moves.urllib.parse import urljoin
4+
from urllib.parse import urljoin
55

66
from openapi_core.validation.request.datatypes import (
77
RequestParameters, OpenAPIRequest,

openapi_core/contrib/requests/requests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""OpenAPI core contrib requests requests module"""
22
from __future__ import absolute_import
3+
from urllib.parse import urlparse, parse_qs
4+
35
from werkzeug.datastructures import ImmutableMultiDict
46
from requests import Request
5-
from six.moves.urllib.parse import urlparse, parse_qs
67

78
from openapi_core.validation.request.datatypes import (
89
RequestParameters, OpenAPIRequest,

openapi_core/deserializing/media_types/util.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from email.parser import Parser
22
from json import loads
3-
4-
from six import binary_type
5-
from six.moves.urllib.parse import parse_qsl
3+
from urllib.parse import parse_qsl
64

75

86
def json_loads(value):
97
# python 3.5 doesn't support binary input fix
10-
if isinstance(value, (binary_type, )):
8+
if isinstance(value, (bytes, )):
119
value = value.decode()
1210
return loads(value)
1311

@@ -17,7 +15,7 @@ def urlencoded_form_loads(value):
1715

1816

1917
def data_form_loads(value):
20-
if issubclass(type(value), binary_type):
18+
if issubclass(type(value), bytes):
2119
value = value.decode('ASCII', errors='surrogateescape')
2220
parser = Parser()
2321
parts = parser.parsestr(value, headersonly=False)

0 commit comments

Comments
 (0)