Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for py27 and py35 #45

Merged
merged 1 commit into from
Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
matrix:
name: [
"docs",
"py27",
"py36",
"py37",
"py38",
Expand All @@ -40,10 +39,6 @@ jobs:
python: "3.6"
os: ubuntu-latest
tox_env: docs
- name: py27
python: "2.7"
os: ubuntu-latest
tox_env: py27
- name: py36
python: "3.6"
os: ubuntu-latest
Expand Down
7 changes: 2 additions & 5 deletions doc8/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
import re

from docutils import nodes as docutils_nodes
import six

from doc8 import utils


@six.add_metaclass(abc.ABCMeta)
class ContentCheck(object):
class ContentCheck(metaclass=abc.ABCMeta):
def __init__(self, cfg):
self._cfg = cfg

Expand All @@ -32,8 +30,7 @@ def report_iter(self, parsed_file):
pass


@six.add_metaclass(abc.ABCMeta)
class LineCheck(object):
class LineCheck(metaclass=abc.ABCMeta):
def __init__(self, cfg):
self._cfg = cfg

Expand Down
8 changes: 4 additions & 4 deletions doc8/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

import argparse
import collections
import configparser
import logging
import os
import sys

import six
from six.moves import configparser

from stevedore import extension

from doc8 import checks
Expand Down Expand Up @@ -320,7 +320,7 @@ def report(self):

if self.error_counts:
lines.append("Detailed error counts:")
for check_name in sorted(six.iterkeys(self.error_counts)):
for check_name in sorted(self.error_counts.keys()):
check_errors = self.error_counts[check_name]
lines.append(" - %s = %s" % (check_name, check_errors))

Expand All @@ -347,7 +347,7 @@ def doc8(args=None, **kwargs):

cfg.setdefault("ignore_path_errors", {})
tmp_ignores = parse_ignore_path_errors(args.pop("ignore_path_errors", []))
for path, ignores in six.iteritems(tmp_ignores):
for path, ignores in tmp_ignores.items():
if path in cfg["ignore_path_errors"]:
cfg["ignore_path_errors"][path].update(ignores)
else:
Expand Down
5 changes: 2 additions & 3 deletions doc8/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from docutils import parsers as docutils_parser
from docutils import utils
import restructuredtext_lint as rl
import six


class ParsedFile(object):
Expand Down Expand Up @@ -90,7 +89,7 @@ def _read(self):
def lines_iter(self, remove_trailing_newline=True):
self._read()
for line in self._lines:
line = six.text_type(line, encoding=self.encoding)
line = str(line, encoding=self.encoding)
if remove_trailing_newline and line.endswith("\n"):
line = line[0:-1]
yield line
Expand Down Expand Up @@ -125,7 +124,7 @@ def raw_contents(self):
@property
def contents(self):
if self._content is None:
self._content = six.text_type(self.raw_contents, encoding=self.encoding)
self._content = str(self.raw_contents, encoding=self.encoding)
return self._content

def __str__(self):
Expand Down
6 changes: 3 additions & 3 deletions doc8/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from mock import patch, MagicMock
import os
import six
from io import StringIO
import shutil
import sys
import testtools
Expand Down Expand Up @@ -87,8 +87,8 @@ class Capture(object):
def __enter__(self):
self.old_out = sys.stdout
self.old_err = sys.stderr
self.out = six.StringIO()
self.err = six.StringIO()
self.out = StringIO()
self.err = StringIO()

sys.stdout = self.out
sys.stderr = self.err
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
chardet
docutils
restructuredtext-lint>=0.7
six
stevedore
Pygments
9 changes: 3 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
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 All @@ -30,9 +27,6 @@ classifier =
console_scripts =
doc8 = doc8.main:main

[wheel]
universal = 1

[flake8]
builtins = _
show-source = True
Expand All @@ -41,3 +35,6 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
max-line-length=160
# See https://github.com/PyCQA/pycodestyle/issues/373
extend-ignore = E203

[options]
python_requires = >=3.6
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 3.8
envlist = lint,py{27,35,36,37,38},docs,packaging
envlist = lint,py{36,37,38},docs,packaging

[testenv]
deps =
Expand Down