Skip to content

Commit

Permalink
Merge branch 'WAKayser-main' into remove-six
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Nov 7, 2023
2 parents c1ad5f4 + a16d1bd commit 3952cb0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 18 deletions.
3 changes: 2 additions & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Changelog
Version 2.0.0
`````````````

unreleased
Unreleased

- Drop support for Python 2.7. Removes dependency on six.
- Add support for Python 3.7 up to 3.12.
- Drop support for Python 3.6 and older.

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@


requires = [
'Sphinx >= 1.6',
'six',
'Sphinx >= 1.6'
]


Expand Down
4 changes: 2 additions & 2 deletions sphinxcontrib/autohttp/bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

import re
import six
import io

from docutils import nodes
from docutils.parsers.rst import directives, Directive
Expand All @@ -26,7 +26,7 @@


def translate_bottle_rule(app, rule):
buf = six.StringIO()
buf = io.StringIO()
if hasattr(app.router, "parse_rule"):
iterator = app.router.parse_rule(rule) # bottle 0.11
else:
Expand Down
9 changes: 4 additions & 5 deletions sphinxcontrib/autohttp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
:license: BSD, see LICENSE for details.
"""
import six
from six.moves import builtins
from six.moves import reduce
from functools import reduce
import builtins

def import_object(import_name):
module_name, expr = import_name.split(':', 1)
Expand All @@ -24,10 +23,10 @@ def import_object(import_name):

def http_directive(method, path, content):
method = method.lower().strip()
if isinstance(content, six.string_types):
if isinstance(content, str):
content = content.splitlines()
yield ''
paths = [path] if isinstance(path, six.string_types) else path
paths = [path] if isinstance(path, str) else path
for path in paths:
yield '.. http:{method}:: {path}'.format(**locals())
yield ''
Expand Down
1 change: 0 additions & 1 deletion sphinxcontrib/autohttp/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import re
import itertools
import six

from docutils import nodes
from docutils.parsers.rst import directives, Directive
Expand Down
9 changes: 4 additions & 5 deletions sphinxcontrib/autohttp/flask_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
:license: BSD, see LICENSE for details.
"""

import io
import re
import itertools
import six
import collections

from docutils.parsers.rst import directives, Directive
Expand Down Expand Up @@ -72,7 +71,7 @@ def parse_rule(rule):


def translate_werkzeug_rule(rule):
buf = six.StringIO()
buf = io.StringIO()
for conv, arg, var in parse_rule(rule):
if conv:
buf.write('(')
Expand All @@ -90,7 +89,7 @@ def get_routes(app, endpoint=None, order=None):
endpoints = []
for rule in app.url_map.iter_rules(endpoint):
url_with_endpoint = (
six.text_type(next(app.url_map.iter_rules(rule.endpoint))),
str(next(app.url_map.iter_rules(rule.endpoint))),
rule.endpoint
)
if url_with_endpoint not in endpoints:
Expand Down Expand Up @@ -128,7 +127,7 @@ def cleanup_methods(methods):
def quickref_directive(method, path, content, blueprint=None, auto=False):
rcomp = re.compile("^\s*.. :quickref:\s*(?P<quick>.*)$")
method = method.lower().strip()
if isinstance(content, six.string_types):
if isinstance(content, str):
content = content.splitlines()
description = ""
name = ""
Expand Down
4 changes: 2 additions & 2 deletions sphinxcontrib/autohttp/tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import inspect
import re
import six
import io

from docutils import nodes
from docutils.parsers.rst import directives, Directive
Expand All @@ -27,7 +27,7 @@


def translate_tornado_rule(app, rule):
buf = six.StringIO()
buf = io.StringIO()
for name, filter, conf in app.router.parse_rule(rule):
if filter:
buf.write('(')
Expand Down

0 comments on commit 3952cb0

Please sign in to comment.