8000 chore: remove old-style classes · python-gitlab/python-gitlab@ae2a015 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae2a015

Browse files
nejchJohnVillalovos
authored andcommitted
chore: remove old-style classes
1 parent 39e7435 commit ae2a015

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

gitlab/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
)
4242

4343

44-
class RESTObject(object):
44+
class RESTObject:
4545
"""Represents an object built from server data.
4646
4747
It holds the attributes know from the server, and the updated attributes in
@@ -234,7 +234,7 @@ def attributes(self) -> Dict[str, Any]:
234234
return d
235235

236236

237-
class RESTObjectList(object):
237+
class RESTObjectList:
238238
"""Generator object representing a list of RESTObject's.
239239
240240
This generator uses the Gitlab pagination system to fetch new data when
@@ -321,7 +321,7 @@ class RequiredOptional(NamedTuple):
321321
optional: Tuple[str, ...] = tuple()
322322

323323

324-
class RESTManager(object):
324+
class RESTManager:
325325
"""Base class for CRUD operations on objects.
326326
327327
Derived class must define ``_path`` and ``_obj_cls``.

gitlab/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
)
3737

3838

39-
class Gitlab(object):
39+
class Gitlab:
4040
"""Represents a GitLab server connection.
4141
4242
Args:
@@ -957,7 +957,7 @@ def search(
957957
return self.http_list("/search", query_data=data, **kwargs)
958958

959959

960-
class GitlabList(object):
960+
class GitlabList:
961961
"""Generator representing a list of remote objects.
962962
963963
The object handles the links returned by a query to the API, and will call

gitlab/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class GitlabConfigHelperError(ConfigError):
101101
pass
102102

103103

104-
class GitlabConfigParser(object):
104+
class GitlabConfigParser:
105105
def __init__(
106106
self, gitlab_id: Optional[str] = None, config_files: Optional[List[str]] = None
107107
) -> None:

gitlab/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from typing import Any, Optional, TYPE_CHECKING
1919

2020

21-
class GitlabAttribute(object):
21+
class GitlabAttribute:
2222
def __init__(self, value: Any = None) -> None:
2323
self._value = value
2424

gitlab/utils.py

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

2323

24-
class _StdoutStream(object):
24+
class _StdoutStream:
2525
def __call__(self, chunk: Any) -> None:
2626
print(chunk)
2727

gitlab/v4/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from gitlab import cli
2828

2929

30-
class GitlabCLI(object):
30+
class GitlabCLI:
3131
def __init__(
3232
self, gl: gitlab.Gitlab, what: str, action: str, args: Dict[str, str]
3333
) -> None:
@@ -359,7 +359,7 @@ def get_dict(
359359
return obj.attributes
360360

361361

362-
class JSONPrinter(object):
362+
class JSONPrinter:
363363
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
364364
import json # noqa
365365

@@ -376,7 +376,7 @@ def display_list(
376376
print(json.dumps([get_dict(obj, fields) for obj in data]))
377377

378378

379-
class YAMLPrinter(object):
379+
class YAMLPrinter:
380380
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
381381
try:
382382
import yaml # noqa
@@ -411,7 +411,7 @@ def display_list(
411411
)
412412

413413

414-
class LegacyPrinter(object):
414+
class LegacyPrinter:
415415
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
416416
verbose = kwargs.get("verbose", False)
417417
padding = kwargs.get("padding", 0)

tests/meta/test_mro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject):
2020
2121
Here is how our classes look when type-checking:
2222
23-
class RESTObject(object):
23+
class RESTObject:
2424
def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None:
2525
...
2626
@@ -52,7 +52,7 @@ class Wrongv4Object(RESTObject, Mixin):
5252
def test_show_issue() -> None:
5353
"""Test case to demonstrate the TypeError that occurs"""
5454

55-
class RESTObject(object):
55+
class RESTObject:
5656
def __init__(self, manager: str, attrs: int) -> None:
5757
...
5858

tests/unit/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from gitlab import base
2424

2525

26-
class FakeGitlab(object):
26+
class FakeGitlab:
2727
pass
2828

2929

@@ -61,7 +61,7 @@ class MGR(base.RESTManager):
6161
_obj_cls = object
6262
_from_parent_attrs = {"test_id": "id"}
6363

64-
class Parent(object):
64+
class Parent:
6565
id = 42
6666

6767
mgr = MGR(FakeGitlab(), parent=Parent())

0 commit comments

Comments
 (0)
0