Skip to content

Commit

Permalink
Merge pull request #41 from edx/usamasadiq/bom-1868-remove-six
Browse files Browse the repository at this point in the history
Removed usages of package six
  • Loading branch information
UsamaSadiq authored Jul 10, 2020
2 parents 10eccfc + 4f1e53b commit 4870b3e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions code_annotations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import re
from abc import ABCMeta, abstractmethod

import six
import yaml
from stevedore import named

Expand Down Expand Up @@ -282,8 +281,7 @@ def _configure_extensions(self):
))


@six.add_metaclass(ABCMeta)
class BaseSearch(object):
class BaseSearch(object, metaclass=ABCMeta):
"""
Base class for searchers.
"""
Expand Down
8 changes: 2 additions & 6 deletions code_annotations/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
import re
from abc import ABCMeta, abstractmethod

import six

from code_annotations.helpers import clean_abs_path, get_annotation_regex


@six.add_metaclass(ABCMeta)
class AnnotationExtension(object):
class AnnotationExtension(object, metaclass=ABCMeta):
"""
Abstract base class that annotation extensions will inherit from.
"""
Expand All @@ -36,8 +33,7 @@ def search(self, file_handle): # pragma: no cover
raise NotImplementedError('search called on base class!')


@six.add_metaclass(ABCMeta)
class SimpleRegexAnnotationExtension(AnnotationExtension):
class SimpleRegexAnnotationExtension(AnnotationExtension, metaclass=ABCMeta):
"""
Abstract base class for languages that have comments which can be reasonably searched using regular expressions.
"""
Expand Down
3 changes: 1 addition & 2 deletions code_annotations/find_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import yaml
from django.apps import apps
from django.db import models
from six import text_type

from code_annotations.base import BaseSearch
from code_annotations.helpers import fail, get_annotation_regex
Expand Down Expand Up @@ -162,7 +161,7 @@ def _append_safelisted_model_annotations(self, safelisted_models, model_id, mode
'annotation_data': comment.strip(),
'extra': {
'object_id': model_id,
'full_comment': text_type(safelisted_models[model_id])
'full_comment': str(safelisted_models[model_id])
}
})

Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from subprocess import check_call

import edx_theme
import six


def get_version(*file_paths):
Expand Down Expand Up @@ -496,5 +495,5 @@ def on_init(app): # pylint: disable=unused-argument

def setup(app):
"""Sphinx extension: run sphinx-apidoc."""
event = 'builder-inited' if six.PY3 else b'builder-inited'
event = 'builder-inited'
app.connect(event, on_init)

0 comments on commit 4870b3e

Please sign in to comment.