Skip to content

Commit f2339df

Browse files
authored
Merge pull request #189 from level12/162-remove-six
remove six and python2 support
2 parents d45a44e + 18a41d6 commit f2339df

34 files changed

+31
-124
lines changed

docs/requirements.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1+
--extra-index-url https://package-index.level12.net
2+
13
sphinx
2-
appdirs
3-
BlazeUtils
4-
blinker
5-
Click>=3.0
6-
Flask
7-
Flask-SQLAlchemy
8-
pathlib
9-
python-json-logger
10-
six
4+
-e .[tests]

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = 'Keg'
24-
copyright = u'{}, Level 12'.format(dt.datetime.utcnow().year)
24+
copyright = '{}, Level 12'.format(dt.datetime.utcnow().year)
2525
author = 'Level 12'
2626

2727
cfg = configparser.SafeConfigParser()

keg/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
from flask import current_app # noqa: F401
42

53
from keg.version import VERSION # noqa: F401

keg/app.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
from __future__ import absolute_import
2-
31
import importlib
42

53
import flask
6-
from six.moves import range
74
from werkzeug.datastructures import ImmutableDict
85

96
from keg.blueprints import keg as kegbp

keg/assets.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
from __future__ import absolute_import
2-
31
from collections import defaultdict
42
import pathlib
53

64
from jinja2 import TemplateNotFound
7-
import six
85

96
from keg.extensions import lazy_gettext as _
107

@@ -33,9 +30,9 @@ def load_asset(self, asset_name):
3330
return False
3431

3532
def load_related(self, template_name):
36-
js_asset_name = six.text_type(pathlib.PurePosixPath(template_name).with_suffix('.js'))
33+
js_asset_name = str(pathlib.PurePosixPath(template_name).with_suffix('.js'))
3734
js_found = self.load_asset(js_asset_name)
38-
css_asset_name = six.text_type(pathlib.PurePosixPath(template_name).with_suffix('.css'))
35+
css_asset_name = str(pathlib.PurePosixPath(template_name).with_suffix('.css'))
3936
css_found = self.load_asset(css_asset_name)
4037
if not js_found and not css_found:
4138
raise AssetException(_('Could not find related assets for template: {template_name}',

keg/blueprints/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
import flask
42

53
from keg.extensions import lazy_gettext as _

keg/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
from __future__ import absolute_import
2-
31
from collections import defaultdict
42
from contextlib import contextmanager
53
from itertools import chain
4+
import urllib
65

76
import click
87
import flask
98
import flask.cli
10-
from six.moves import urllib
119

1210
from keg import current_app
1311
from keg.extensions import gettext as _

keg/compat.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

keg/config.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
from __future__ import absolute_import
2-
31
import os.path as osp
42

53
import appdirs
64
from blazeutils.helpers import tolist
75
import flask
86
from pathlib import PurePath
9-
import six
107
from werkzeug.utils import (
118
import_string,
129
ImportStringError
@@ -191,7 +188,7 @@ class TestProfile(object):
191188
KEG_LOG_SYSLOG_ENABLED = False
192189

193190
# set this to allow generation of URLs without a request context
194-
SERVER_NAME = 'keg.example.com' if six.PY3 else b'keg.example.com'
191+
SERVER_NAME = 'keg.example.com'
195192

196193
# simple value for testing is fine
197194
SECRET_KEY = '12345'

keg/ctx.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
from flask.ctx import RequestContext
42
from keg.assets import AssetManager
53

0 commit comments

Comments
 (0)