Skip to content

Commit

Permalink
Remove dependency on typing_extensions
Browse files Browse the repository at this point in the history
Protocol is part of the standard lib since Python 3.8.
  • Loading branch information
amolenaar committed Oct 20, 2021
1 parent a1d0108 commit 084a55d
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 104 deletions.
4 changes: 1 addition & 3 deletions gaphas/aspect/connector.py
@@ -1,7 +1,5 @@
from functools import singledispatch
from typing import Callable, Optional

from typing_extensions import Protocol
from typing import Callable, Optional, Protocol

from gaphas.connections import Connections
from gaphas.connector import Handle, LinePort, Port
Expand Down
3 changes: 1 addition & 2 deletions gaphas/canvas.py
Expand Up @@ -28,10 +28,9 @@
from __future__ import annotations

import logging
from typing import TYPE_CHECKING, Iterable
from typing import TYPE_CHECKING, Iterable, Protocol

import cairo
from typing_extensions import Protocol

from gaphas import matrix, tree
from gaphas.connections import Connection, Connections
Expand Down
4 changes: 1 addition & 3 deletions gaphas/item.py
Expand Up @@ -3,9 +3,7 @@

from dataclasses import dataclass
from math import atan2
from typing import TYPE_CHECKING, Iterable, Sequence

from typing_extensions import Protocol, runtime_checkable
from typing import TYPE_CHECKING, Iterable, Protocol, Sequence, runtime_checkable

from gaphas.connector import Handle, LinePort, Port
from gaphas.constraint import Constraint, EqualsConstraint, constraint
Expand Down
4 changes: 1 addition & 3 deletions gaphas/painter/painter.py
Expand Up @@ -6,9 +6,7 @@
and handles).
"""

from typing import Collection

from typing_extensions import Protocol
from typing import Collection, Protocol

from gaphas.item import Item
from gaphas.types import CairoContext
Expand Down
4 changes: 1 addition & 3 deletions gaphas/solver/constraint.py
@@ -1,8 +1,6 @@
from __future__ import annotations

from typing import Callable, Collection, Hashable

from typing_extensions import Protocol, runtime_checkable
from typing import Callable, Collection, Hashable, Protocol, runtime_checkable

from gaphas.solver.variable import Variable

Expand Down
15 changes: 12 additions & 3 deletions gaphas/table.py
Expand Up @@ -2,9 +2,18 @@
would in a database table, with indexes on the desired "columns."."""

from functools import reduce
from typing import Dict, Generic, Iterator, Sequence, Set, Tuple, Type, TypeVar

from typing_extensions import Protocol, runtime_checkable
from typing import (
Dict,
Generic,
Iterator,
Protocol,
Sequence,
Set,
Tuple,
Type,
TypeVar,
runtime_checkable,
)

T = TypeVar("T", bound=Tuple, covariant=True)

Expand Down
3 changes: 1 addition & 2 deletions gaphas/types.py
@@ -1,7 +1,6 @@
from typing import List, Optional, Sequence, SupportsFloat, Tuple, TypeVar
from typing import List, Optional, Protocol, Sequence, SupportsFloat, Tuple, TypeVar

import cairo
from typing_extensions import Protocol

# A primitive position, tuple ``(x, y)``
# Pos = Tuple[Union[float, SupportsFloat], Union[float, SupportsFloat]]
Expand Down
4 changes: 1 addition & 3 deletions gaphas/view/model.py
@@ -1,8 +1,6 @@
from __future__ import annotations

from typing import Collection, Iterable

from typing_extensions import Protocol, runtime_checkable
from typing import Collection, Iterable, Protocol, runtime_checkable

from gaphas.connections import Connections
from gaphas.item import Item
Expand Down
163 changes: 82 additions & 81 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -33,7 +33,6 @@ classifiers = [
python = "^3.8"
PyGObject = "^3.38.0"
pycairo = "^1.20.0"
typing-extensions = "^3.7.4"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
Expand Down

0 comments on commit 084a55d

Please sign in to comment.