Skip to content

Commit 037ce5e

Browse files
committed
Update supported python versions
1 parent 2d98033 commit 037ce5e

10 files changed

Lines changed: 21 additions & 100 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.7"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1515

1616
steps:
1717
- uses: actions/checkout@v3

backslash/__version__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import pkg_resources
1+
import importlib.metadata
22

3-
__version__ = pkg_resources.get_distribution('backslash').version
3+
4+
__version__ = importlib.metadata.distribution("backslash").version

backslash/_compat.py

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

backslash/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from urlobject import URLObject as URL
1313

1414
from .__version__ import __version__ as BACKSLASH_CLIENT_VERSION
15-
from ._compat import BytesIO, TextIOWrapper, iteritems
15+
from io import BytesIO, TextIOWrapper
1616
from .comment import Comment
1717
from .error import Error
1818
from .exceptions import BackslashClientException, ParamsTooLarge
@@ -165,7 +165,7 @@ def _serialize_params(self, params: Optional[Dict[str, Any]]) -> Tuple[bool, Dic
165165
if compute_memory_usage(params) > _MAX_PARAMS_UNCOMPRESSED_SIZE:
166166
raise ParamsTooLarge()
167167

168-
for param_name, param_value in iteritems(params):
168+
for param_name, param_value in params.items():
169169
if param_value is NOTHING:
170170
continue
171171
returned[param_name] = param_value

backslash/contrib/slash_plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import itertools
66
import json
77
import os
8-
import pkg_resources
98
import socket
109
import sys
1110
import time
@@ -27,7 +26,8 @@
2726
from slash.utils.conf_utils import Cmdline, Doc
2827
from urlobject import URLObject as URL
2928
from requests import HTTPError
30-
from .._compat import shellquote
29+
from shlex import quote as shellquote
30+
from packaging.version import parse as parse_version
3131
from ..client import Backslash as BackslashClient
3232
from ..exceptions import ParamsTooLarge
3333
from ..utils import ensure_dir
@@ -327,7 +327,7 @@ def get_tests_to_resume(self, session_id, filters_dict):
327327

328328
def _get_test_info(self, test):
329329
if test.__slash__.is_interactive() and \
330-
pkg_resources.parse_version(slash.__version__) < pkg_resources.parse_version('1.6.0'):
330+
parse_version(slash.__version__) < parse_version('1.6.0'):
331331
returned = {
332332
'file_name': '<interactive>',
333333
'class_name': '<interactive>',

backslash/contrib/utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import os
44
import types
55

6-
from .._compat import PY2
7-
86
try:
97
from slash import config as slash_config
108
except ImportError:
@@ -16,14 +14,9 @@
1614
_HERE = os.path.abspath('.')
1715

1816
_ALLOWED_ATTRIBUTE_TYPES = [int, str, float]
19-
if PY2:
20-
_ALLOWED_ATTRIBUTE_TYPES.append(long) # pylint: disable=undefined-variable
2117
_ALLOWED_ATTRIBUTE_TYPES = tuple(_ALLOWED_ATTRIBUTE_TYPES)
2218

2319
_FILTERED_MEMBER_TYPES = [types.MethodType, types.FunctionType, type]
24-
if PY2:
25-
_FILTERED_MEMBER_TYPES.append(types.UnboundMethodType) # pylint: disable=no-member
26-
_FILTERED_MEMBER_TYPES.append(types.ClassType) # pylint: disable=no-member
2720
_FILTERED_MEMBER_TYPES = tuple(_FILTERED_MEMBER_TYPES)
2821

2922
_MAX_VARIABLE_VALUE_LENGTH = 100

backslash/error_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import tempfile
44

5-
from ._compat import TextIOWrapper
5+
from io import TextIOWrapper
66

77
import logbook
88
from sentinels import NOTHING

backslash/lazy_query.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from sentinels import NOTHING
55

6-
from ._compat import iteritems
76
from .utils import raise_for_status
87

98

@@ -32,7 +31,7 @@ def filter(self, *filter_objects, **fields):
3231
returned_url = self._url
3332
for filter_object in filter_objects:
3433
returned_url = filter_object.add_to_url(returned_url)
35-
for field_name, field_value in iteritems(fields):
34+
for field_name, field_value in fields.items():
3635
returned_url = returned_url.add_query_param(field_name, str(field_value))
3736
return LazyQuery(self._client, url=returned_url, page_size=self._page_size)
3837

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
=========
33

4+
* :feature:`-` Support python versions 3.8 to 3.12
5+
* :feature:`-` Use pyproject.toml for project configuration
46
* :feature:`104` Drop support for python version < 3.6
57
* :release:`2.39.0 <03-07-2019>`
68
* :feature:`101` Report if error is fatal

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ build-backend = "hatchling.build"
66
name = "backslash"
77
description = "Client library for the Backslash test reporting service"
88
readme = "README.md"
9-
requires-python = ">=3.7"
9+
requires-python = ">=3.8"
1010
license = { text = "BSD 3-Clause License" }
1111

12-
classifiers = ["Programming Language :: Python :: 3.7"]
12+
classifiers = [
13+
"Programming Language :: Python :: 3.8",
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
]
1319
dependencies = [
1420
"GitPython",
1521
"Logbook",

0 commit comments

Comments
 (0)