Skip to content

Commit

Permalink
Change: Drop typing_extensions dependency.
Browse files Browse the repository at this point in the history
Drop the use of the Self component from typing_extensions and use
the typing library instead
  • Loading branch information
a-h-abdelsalam authored and greenbonebot committed Jul 17, 2024
1 parent fb2931b commit 3957bcf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions gvm/_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#

from enum import Enum as PythonEnum
from typing import Any, Optional

from typing_extensions import Self
from typing import Any, Optional, TypeVar

from gvm.errors import InvalidArgument

Self = TypeVar("Self", bound="PythonEnum")


class Enum(PythonEnum):
"""
Expand Down
7 changes: 3 additions & 4 deletions gvm/protocols/_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from types import TracebackType
from typing import Callable, Generic, Optional, Type

from typing_extensions import Self, TypeVar
from typing import Callable, Generic, Optional, Type, TypeVar

from gvm.connections import GvmConnection

from .core import Connection, Request, Response

T = TypeVar("T", default=str)
T = TypeVar("T")
Self = TypeVar("Self", bound="GvmProtocol")


def str_transform(response: Response) -> str:
Expand Down
7 changes: 4 additions & 3 deletions gvm/protocols/core/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from functools import cached_property
from typing import Optional

from typing_extensions import Self
from typing import Optional, TypeVar

from gvm.errors import GvmError
from gvm.xml import Element, parse_xml
Expand All @@ -26,6 +24,9 @@ def __init__(self, message: Optional[str], *args, response: "Response"):
self.request = response.request


Self = TypeVar("Self", bound="Response")


class Response:
"""
A GMP Response
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ packages = [{ include = "gvm" }, { include = "tests", format = "sdist" }]
python = "^3.9"
paramiko = ">=2.7.1"
lxml = ">=4.5.0"
typing-extensions = ">=4.9.0"

[tool.poetry.group.dev.dependencies]
coverage = ">=7.2"
Expand Down

0 comments on commit 3957bcf

Please sign in to comment.