Skip to content

Commit

Permalink
Remove support for end-of-life Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl committed Jul 18, 2023
1 parent ac5e46d commit fedaa71
Show file tree
Hide file tree
Showing 28 changed files with 68 additions and 135 deletions.
33 changes: 0 additions & 33 deletions .appveyor.yml

This file was deleted.

12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ name: build
on: push
jobs:
tox:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
tox:
- py27
- py36
- py37
- py310
- pre-commit
- mypy
- docs
# TODO: benchmark blocked on https://github.com/actions/toolkit/issues/399
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'
- run: pip install tox
- run: tox -e ${{ matrix.tox }}
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Setup
tox

# Install git pre-commit hooks
.tox/py27/bin/pre-commit install
.tox/py310/bin/pre-commit install


Contributing
Expand Down
23 changes: 4 additions & 19 deletions bravado_core/_compat.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
import sys


if sys.version_info[0] == 2: # pragma: no cover # py2
from functools32 import wraps # noqa: F401
else: # pragma: no cover # py3+
from functools import wraps # noqa: F401


try:
from collections.abc import Mapping # noqa: F401 # pragma: no cover # py3.3+
except ImportError: # pragma: no cover
from collections import Mapping # noqa: F401 # py3.2 or older


if sys.version_info[0:2] <= (3, 4): # pragma: no cover # py3.4 or older
from inspect import getargspec as get_function_spec # noqa: F401
else: # pragma: no cover # py3.5+
from inspect import getfullargspec as get_function_spec # noqa: F401
# TODO: remove this module entirely.
from collections.abc import Mapping # noqa: F401
from functools import wraps # noqa: F401
from inspect import getfullargspec as get_function_spec # noqa: F401
1 change: 1 addition & 0 deletions bravado_core/_compat_typing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import typing

from mypy_extensions import Arg

try:
Expand Down
4 changes: 2 additions & 2 deletions bravado_core/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def wrapper(value):
return value
return func(value)

return wrapper
return wrapper # type: ignore

return external_wrapper

Expand Down Expand Up @@ -82,4 +82,4 @@ def wrapper(*args, **kwargs):
except RecursiveCallException:
return lambda *new_args, **new_kawrgs: func(*args, **kwargs)(*new_args, **new_kawrgs)

return wrapper
return wrapper # type: ignore
2 changes: 1 addition & 1 deletion bravado_core/exception.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import sys
import typing

import six
import typing


if getattr(typing, 'TYPE_CHECKING', False):
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import base64
import functools
import typing

import dateutil.parser
import pytz
import six
import typing

from bravado_core import schema
from bravado_core.exception import SwaggerMappingError
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/marshal.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import typing
import warnings
from functools import partial

import typing
from six import iteritems

from bravado_core import _decorators
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import functools
import logging
import re
import typing
from copy import deepcopy
from warnings import warn

import typing
from six import add_metaclass
from six import iteritems
from six import string_types
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/operation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import logging

import typing

from six import iteritems
from six import PY2

Expand Down
2 changes: 1 addition & 1 deletion bravado_core/param.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import logging
import typing
from functools import partial

import simplejson as json
import six
import typing
from six.moves.urllib.parse import quote

from bravado_core import schema
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/resource.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import logging
import typing
from collections import defaultdict
from copy import deepcopy
from itertools import chain

import typing
from six import iteritems
from six import iterkeys
from six import PY2
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import copy

import typing

from six import iteritems
from six import string_types

Expand Down
3 changes: 1 addition & 2 deletions bravado_core/security_definition.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import logging
from copy import deepcopy

import typing
from copy import deepcopy


if getattr(typing, 'TYPE_CHECKING', False):
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/security_requirement.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import logging
import typing

import six
import typing

from bravado_core.exception import SwaggerSchemaError

Expand Down
4 changes: 2 additions & 2 deletions bravado_core/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import json
import logging
import os.path
import typing
import warnings
from copy import deepcopy
from itertools import chain

import requests
import typing
import yaml
from jsonref import JsonRef
from jsonschema import FormatChecker
Expand Down Expand Up @@ -410,7 +410,7 @@ def _force_deref(self, ref_dict):
# Restore attached resolution scope before resolving since the
# resolver doesn't have a traversal history (accumulated scope_stack)
# when asked to resolve.
with in_scope(self.resolver, ref_dict):
with in_scope(self.resolver, ref_dict): # type: ignore
reference_value = ref_dict['$ref'] # type: ignore
_, target = self.resolver.resolve(reference_value)
return target
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/swagger20_validator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import functools

import typing

from jsonschema import FormatChecker
from jsonschema import RefResolver
from jsonschema import validators
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/unmarshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Unmarshaling is the operation that converts a "JSON" object into its python representation.
The operation should also take care of converting types accordingly to the defined :class:`bravado_core.formatter.SwaggerFormat`s.
"""
import typing
import warnings
from functools import partial

import typing
from six import iteritems

from bravado_core import _decorators
Expand Down
2 changes: 1 addition & 1 deletion bravado_core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import copy
import inspect
import re

import typing
from enum import Enum

from six import iteritems
from six import iterkeys

Expand Down
2 changes: 1 addition & 1 deletion bravado_core/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
customize the behavior.
"""
import sys
import typing

import jsonschema
import typing
from six import itervalues
from six import reraise

Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[mypy]
ignore_missing_imports = True
python_version = 2.7
python_version = 3.10
strict_optional = True
warn_redundant_casts = True
disallow_untyped_calls = True
Expand Down
16 changes: 12 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Unit test dependencies
# TODO: avoids an issue with hanging forever in tests (CORESERV-12009).
jsonschema<4
mock
mypy-extensions; python_version>='3.5'
mypy; python_version>='3.5'
mypy
mypy-extensions
pre-commit
pytest
pytest-benchmark[histogram]
pytest-cov
pytest<4.7 # need support for Python 2.7, see https://docs.pytest.org/en/latest/py27-py34-deprecation.html
types-mock
types-python-dateutil
types-pytz
types-pyyaml
types-requests
types-simplejson
types-six
48 changes: 19 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,11 @@
# Copyright (c) 2013, Digium, Inc.
# Copyright (c) 2014-2015, Yelp, Inc.
import os
import sys

from setuptools import setup

import bravado_core

install_requires = [
"jsonref",
"jsonschema[format]>=2.5.1",
"python-dateutil",
"pyyaml",
'requests',
"simplejson",
"six",
"swagger-spec-validator>=2.0.1",
"pytz",
"msgpack>=0.5.2",
]

# pyrsistent dropped python2 support in 0.17.0
if sys.version_info < (3, 5):
install_requires.append('pyrsistent<0.17')

setup(
name="bravado-core",
Expand All @@ -37,6 +20,7 @@
"README.rst",
),
).read(),
long_description_content_type='text/markdown',
author="Digium, Inc. and Yelp, Inc.",
author_email="[email protected]",
url="https://github.com/Yelp/bravado-core",
Expand All @@ -47,20 +31,26 @@
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
install_requires=[
"jsonref",
"jsonschema[format]>=2.5.1",
"python-dateutil",
"pyyaml",
'requests',
"simplejson",
"six",
"swagger-spec-validator>=2.0.1",
"pytz",
"msgpack>=0.5.2",
],
install_requires=install_requires,
package_data={
'bravado_core': ['py.typed'],
},
# https://mypy.readthedocs.io/en/latest/installed_packages.html
zip_safe=False,
extras_require={
':python_version<"3.5"': ['typing'],
':python_version<"3.4"': ['enum34'],
':python_version<"3.2"': ['functools32'],
},
python_requires='!=3.0,!=3.1,!=3.2,!=3.3,!=3.4,!=3.5.0',
python_requires='>=3.8',
)
Loading

0 comments on commit fedaa71

Please sign in to comment.