Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python versions #114

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions backslash/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pkg_resources
import importlib.metadata

__version__ = pkg_resources.get_distribution('backslash').version

__version__ = importlib.metadata.distribution("backslash").version
80 changes: 0 additions & 80 deletions backslash/_compat.py

This file was deleted.

4 changes: 2 additions & 2 deletions backslash/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from urlobject import URLObject as URL

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

for param_name, param_value in iteritems(params):
for param_name, param_value in params.items():
if param_value is NOTHING:
continue
returned[param_name] = param_value
Expand Down
6 changes: 3 additions & 3 deletions backslash/contrib/slash_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import itertools
import json
import os
import pkg_resources
import socket
import sys
import time
Expand All @@ -27,7 +26,8 @@
from slash.utils.conf_utils import Cmdline, Doc
from urlobject import URLObject as URL
from requests import HTTPError
from .._compat import shellquote
from shlex import quote as shellquote
from packaging.version import parse as parse_version
from ..client import Backslash as BackslashClient
from ..exceptions import ParamsTooLarge
from ..utils import ensure_dir
Expand Down Expand Up @@ -327,7 +327,7 @@ def get_tests_to_resume(self, session_id, filters_dict):

def _get_test_info(self, test):
if test.__slash__.is_interactive() and \
pkg_resources.parse_version(slash.__version__) < pkg_resources.parse_version('1.6.0'):
parse_version(slash.__version__) < parse_version('1.6.0'):
returned = {
'file_name': '<interactive>',
'class_name': '<interactive>',
Expand Down
7 changes: 0 additions & 7 deletions backslash/contrib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import os
import types

from .._compat import PY2

try:
from slash import config as slash_config
except ImportError:
Expand All @@ -16,14 +14,9 @@
_HERE = os.path.abspath('.')

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

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

_MAX_VARIABLE_VALUE_LENGTH = 100
Expand Down
2 changes: 1 addition & 1 deletion backslash/error_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import tempfile

from ._compat import TextIOWrapper
from io import TextIOWrapper

import logbook
from sentinels import NOTHING
Expand Down
3 changes: 1 addition & 2 deletions backslash/lazy_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from sentinels import NOTHING

from ._compat import iteritems
from .utils import raise_for_status


Expand Down Expand Up @@ -32,7 +31,7 @@ def filter(self, *filter_objects, **fields):
returned_url = self._url
for filter_object in filter_objects:
returned_url = filter_object.add_to_url(returned_url)
for field_name, field_value in iteritems(fields):
for field_name, field_value in fields.items():
returned_url = returned_url.add_query_param(field_name, str(field_value))
return LazyQuery(self._client, url=returned_url, page_size=self._page_size)

Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog
=========

* :feature:`-` Support python versions 3.8 to 3.12
* :feature:`-` Use pyproject.toml for project configuration
* :feature:`104` Drop support for python version < 3.6
* :release:`2.39.0 <03-07-2019>`
* :feature:`101` Report if error is fatal
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ build-backend = "hatchling.build"
name = "backslash"
description = "Client library for the Backslash test reporting service"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = { text = "BSD 3-Clause License" }

classifiers = ["Programming Language :: Python :: 3.7"]
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"GitPython",
"Logbook",
Expand Down