Skip to content

Commit 81c4231

Browse files
Merge pull request #1169 from camporter/drop_python2
Drop python2.7 support
2 parents 880f23e + 78f196f commit 81c4231

25 files changed

+54
-85
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matrix:
1111
- python: "3.7"
1212
env: TOX_ENV=py37
1313
- python: "pypy3.5"
14-
env: TOX_ENV=pypy
14+
env: TOX_ENV=pypy3
1515
- python: "3.6"
1616
env: TOX_ENV=analysis
1717
- python: "3.6"

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ If you are using the library directly in python, you can do something like this.
124124

125125
System Requirements
126126
-------------------
127-
* Python 2.7, 3.3, 3.4, 3.5, 3.6, or 3.7.
127+
* Python 3.5, 3.6, or 3.7.
128128
* A valid SoftLayer API username and key.
129129
* A connection to SoftLayer's private network is required to use
130130
our private network API endpoints.
131131

132132
Python Packages
133133
---------------
134-
* six >= 1.7.0
135134
* ptable >= 0.9.2
136135
* click >= 7
137136
* requests >= 2.20.0

SoftLayer/API.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
:license: MIT, see LICENSE for more details.
77
"""
88
# pylint: disable=invalid-name
9-
from __future__ import generators
109
import warnings
1110

1211

SoftLayer/CLI/config/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Setup CLI configuration."""
22
# :license: MIT, see LICENSE for more details.
3+
import configparser
34
import os.path
45

56
import click
@@ -9,7 +10,6 @@
910
from SoftLayer.CLI import environment
1011
from SoftLayer.CLI import exceptions
1112
from SoftLayer.CLI import formatting
12-
from SoftLayer import utils
1313

1414

1515
def get_api_key(client, username, secret):
@@ -65,11 +65,11 @@ def cli(env):
6565

6666
# Persist the config file. Read the target config file in before
6767
# setting the values to avoid clobbering settings
68-
parsed_config = utils.configparser.RawConfigParser()
68+
parsed_config = configparser.RawConfigParser()
6969
parsed_config.read(config_path)
7070
try:
7171
parsed_config.add_section('softlayer')
72-
except utils.configparser.DuplicateSectionError:
72+
except configparser.DuplicateSectionError:
7373
pass
7474

7575
parsed_config.set('softlayer', 'username', username)

SoftLayer/CLI/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
:license: MIT, see LICENSE for more details.
77
"""
8-
from __future__ import print_function
98
import logging
109
import os
1110
import sys

SoftLayer/CLI/deprecated.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Handles usage of the deprecated command name, 'sl'.
55
:license: MIT, see LICENSE for more details.
66
"""
7-
from __future__ import print_function
87
import sys
98

109

SoftLayer/CLI/formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def format_output(data, fmt='table'): # pylint: disable=R0911,R0912
3030
SequentialOutput
3131
:param string fmt (optional): One of: table, raw, json, python
3232
"""
33-
if isinstance(data, utils.string_types):
33+
if isinstance(data, str):
3434
if fmt in ('json', 'jsonraw'):
3535
return json.dumps(data)
3636
return data

SoftLayer/CLI/report/bandwidth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Metric Utilities"""
2-
from __future__ import print_function
32
import datetime
43
import itertools
54
import sys

SoftLayer/CLI/template.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"""
1010

1111
# pylint: disable=redefined-argument-from-local
12+
import configparser
13+
import io
1214
import os.path
1315

14-
from SoftLayer import utils
15-
1616

1717
class TemplateCallback(object):
1818
"""Callback to use to populate click arguments with a template."""
@@ -24,11 +24,11 @@ def __call__(self, ctx, param, value):
2424
if value is None:
2525
return
2626

27-
config = utils.configparser.ConfigParser()
27+
config = configparser.ConfigParser()
2828
ini_str = '[settings]\n' + open(
2929
os.path.expanduser(value), 'r').read()
30-
ini_fp = utils.StringIO(ini_str)
31-
config.readfp(ini_fp)
30+
ini_fp = io.StringIO(ini_str)
31+
config.read_file(ini_fp)
3232

3333
# Merge template options with the options passed in
3434
args = {}

SoftLayer/config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
66
:license: MIT, see LICENSE for more details.
77
"""
8+
import configparser
89
import os
910
import os.path
1011

11-
from SoftLayer import utils
12-
1312

1413
def get_client_settings_args(**kwargs):
1514
"""Retrieve client settings from user-supplied arguments.
@@ -51,7 +50,7 @@ def get_client_settings_config_file(**kwargs): # pylint: disable=inconsistent-r
5150
if kwargs.get('config_file'):
5251
config_files.append(kwargs.get('config_file'))
5352
config_files = [os.path.expanduser(f) for f in config_files]
54-
config = utils.configparser.RawConfigParser({
53+
config = configparser.RawConfigParser({
5554
'username': '',
5655
'api_key': '',
5756
'endpoint_url': '',

0 commit comments

Comments
 (0)