Skip to content

Commit

Permalink
Drop Python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Aug 31, 2020
1 parent 938f6ca commit bae96d7
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v2.4.1
hooks:
- id: pyupgrade
args: [--py3-plus]
args: [--py36-plus]
- repo: https://github.com/python/black
rev: 19.10b0
hooks:
Expand Down
1 change: 0 additions & 1 deletion azure-pipelines.yml
Expand Up @@ -27,7 +27,6 @@ jobs:
toxenvs:
- lint

- py35-marshmallow3
- py36-marshmallow3
- py37-marshmallow3
- py38-marshmallow3
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -26,7 +26,7 @@
source_suffix = ".rst"
master_doc = "index"
project = "apispec"
copyright = "Steven Loria {:%Y}".format(dt.datetime.utcnow())
copyright = f"Steven Loria {dt.datetime.utcnow():%Y}"

version = release = apispec.__version__

Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
@@ -1,7 +1,7 @@
Install
=======

**apispec** requires Python >= 3.5.
**apispec** requires Python >= 3.6.

From the PyPI
-------------
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
@@ -0,0 +1,3 @@
[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -60,11 +60,10 @@ def read(fname):
license="MIT",
zip_safe=False,
keywords="apispec swagger openapi specification oas documentation spec rest api",
python_requires=">=3.5",
python_requires=">=3.6",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
8 changes: 4 additions & 4 deletions src/apispec/core.py
Expand Up @@ -72,7 +72,7 @@ def schema(self, name, component=None, **kwargs):
"""
if name in self._schemas:
raise DuplicateComponentNameError(
'Another schema with name "{}" is already registered.'.format(name)
f'Another schema with name "{name}" is already registered.'
)
component = component or {}
ret = component.copy()
Expand Down Expand Up @@ -151,7 +151,7 @@ def example(self, name, component, **kwargs):
"""
if name in self._examples:
raise DuplicateComponentNameError(
'Another example with name "{}" is already registered.'.format(name)
f'Another example with name "{name}" is already registered.'
)
self._examples[name] = component
return self
Expand Down Expand Up @@ -243,7 +243,7 @@ def path(
summary=None,
description=None,
parameters=None,
**kwargs
**kwargs,
):
"""Add a new path object to the spec.
Expand Down Expand Up @@ -323,7 +323,7 @@ def clean_parameters(self, parameters):
missing_attrs = [attr for attr in ("name", "in") if attr not in parameter]
if missing_attrs:
raise InvalidParameterError(
"Missing keys {} for parameter".format(missing_attrs)
f"Missing keys {missing_attrs} for parameter"
)

# OpenAPI Spec 3 and 2 don't allow for duplicated parameters
Expand Down
2 changes: 1 addition & 1 deletion src/apispec/ext/marshmallow/common.py
Expand Up @@ -61,7 +61,7 @@ def get_fields(schema, *, exclude_dump_only=False):
fields = copy.deepcopy(schema._declared_fields)
else:
raise ValueError(
"{!r} doesn't have either `fields` or `_declared_fields`.".format(schema)
f"{schema!r} doesn't have either `fields` or `_declared_fields`."
)
Meta = getattr(schema, "Meta", None)
warn_if_fields_defined_in_meta(fields, Meta)
Expand Down
2 changes: 1 addition & 1 deletion src/apispec/utils.py
Expand Up @@ -103,7 +103,7 @@ def __init__(self, openapi_version):
< self.MAX_EXCLUSIVE_VERSION
):
raise exceptions.APISpecError(
"Not a valid OpenAPI version number: {}".format(openapi_version)
f"Not a valid OpenAPI version number: {openapi_version}"
)
super().__init__(openapi_version)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_core.py
Expand Up @@ -60,7 +60,7 @@ def spec(request):
version="1.0.0",
openapi_version=openapi_version,
info={"description": description},
**security_kwargs
**security_kwargs,
)


Expand Down Expand Up @@ -742,10 +742,10 @@ def __init__(self, index, output):
self.output = output

def path_helper(self, path, operations, **kwargs):
self.output.append("plugin_{}_path".format(self.index))
self.output.append(f"plugin_{self.index}_path")

def operation_helper(self, path, operations, **kwargs):
self.output.append("plugin_{}_operations".format(self.index))
self.output.append(f"plugin_{self.index}_operations")

def test_plugins_order(self):
"""Test plugins execution order in APISpec.path
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,7 +1,7 @@
[tox]
envlist=
lint
py{35,36,37,38}-marshmallow3
py{36,37,38}-marshmallow3
py38-marshmallowdev
docs

Expand Down

0 comments on commit bae96d7

Please sign in to comment.