Skip to content

Commit

Permalink
Merge pull request #2137 from allmightyspiff/py312-2
Browse files Browse the repository at this point in the history
Added support for python 3.12
  • Loading branch information
allmightyspiff authored Apr 24, 2024
2 parents f796629 + aba20cf commit 6864ea2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8,3.9,'3.10',3.11]
python-version: [3.8,3.9,'3.10',3.11,3.12]

steps:
- uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
21 changes: 1 addition & 20 deletions SoftLayer/CLI/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from json.decoder import JSONDecodeError

import click
import pkg_resources

from rich.console import Console
from rich.syntax import Syntax

Expand All @@ -23,9 +23,6 @@

# pylint: disable=too-many-instance-attributes, invalid-name

# Calling pkg_resources.iter_entry_points shows a false-positive
# pylint: disable=no-member


class Environment(object):
"""Provides access to the current CLI environment."""
Expand Down Expand Up @@ -165,8 +162,6 @@ def load(self):

self.load_modules_from_python(routes.ALL_ROUTES)
self.aliases.update(routes.ALL_ALIASES)
self._load_modules_from_entry_points('softlayer.cli')

self._modules_loaded = True

def load_modules_from_python(self, route_list):
Expand All @@ -178,20 +173,6 @@ def load_modules_from_python(self, route_list):
path, attr = modpath, None
self.commands[name] = ModuleLoader(path, attr=attr)

def _load_modules_from_entry_points(self, entry_point_group):
"""Load modules from the entry_points (slower).
Entry points can be used to add new commands to the CLI.
Usage:
entry_points={'softlayer.cli': ['new-cmd = mymodule.new_cmd.cli']}
"""
for obj in pkg_resources.iter_entry_points(group=entry_point_group,
name=None):
self.commands[obj.name] = obj

def ensure_client(self, config_file=None, is_demo=False, proxy=None):
"""Create a new SLAPI client to the environment.
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/CLI/event_log/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def cli(env, date_min, date_max, obj_event, obj_id, obj_type, utc_offset, metada
f"'{user}','{metadata_data}'")
else:
click.secho(f"'{log['eventName']}','{label}','{log['objectName']}',"
f"'{utils.clean_time(log['eventCreateDate'],in_format=log_time)}',"
f"'{utils.clean_time(log['eventCreateDate'], in_format=log_time)}',"
f"'{user}'")

row_count = row_count + 1
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/CLI/file/access/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@click.option('--sortby', help='Column to sort by', default='name')
@click.option('--columns',
callback=column_helper.get_formatter(storage_utils.COLUMNS),
help=f"Columns to display. Options: { ', '.join(column.name for column in storage_utils.COLUMNS)}",
help=f"Columns to display. Options: {', '.join(column.name for column in storage_utils.COLUMNS)}",
default=','.join(storage_utils.DEFAULT_COLUMNS))
@environment.pass_env
def cli(env, columns, sortby, volume_id):
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/managers/ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def get_package_by_key(self, package_keyname, mask=None):
"""
_filter = {'keyName': {'operation': package_keyname}}

packages = self.package_svc.getAllObjects(mask=mask, filter=_filter)
packages = self.client.call('SoftLayer_Product_Package', 'getAllObjects', mask=mask, filter=_filter)
if len(packages) == 0:
raise exceptions.SoftLayerError(f"Package {package_keyname} does not exist")

Expand Down
4 changes: 2 additions & 2 deletions SoftLayer/testing/xmlrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# pylint: disable=invalid-name, broad-except, arguments-differ


class TestServer(http.server.HTTPServer):
class TestServer(http.server.ThreadingHTTPServer):
"""Test HTTP server which holds a given transport."""

def __init__(self, transport, *args, **kw):
http.server.HTTPServer.__init__(self, *args, **kw)
http.server.ThreadingHTTPServer.__init__(self, *args, **kw)
self.transport = transport


Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37,py38,py39,py310,py311,pypy3,analysis,coverage,docs
envlist = py38,py39,py310,py311,py312,pypy3,analysis,coverage,docs


[flake8]
Expand Down

0 comments on commit 6864ea2

Please sign in to comment.