Skip to content

Commit

Permalink
fix version issues in docs build.
Browse files Browse the repository at this point in the history
typing-extensions is no longer in our requirements.txt, but is still used.
We include typing-extensions transitively through our
requirements-txt dependencies, so all GH actions are succeeding (because they
all install the test requirements). But, our docs build does not,
and is failing as a consequence.

We no longer support python 3.7, so can import from typing instead.

PiperOrigin-RevId: 549348815
  • Loading branch information
LenaMartens authored and copybara-github committed Jul 19, 2023
1 parent 1d54377 commit 8d3b4e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 1 addition & 8 deletions haiku/_src/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import functools
import inspect
import re
import sys
from typing import (Any, Callable, ContextManager, Dict, Mapping, NamedTuple,
Optional, Set, Tuple, Type, TypeVar)
Optional, Protocol, Set, Tuple, Type, TypeVar)

from haiku._src import base
from haiku._src import config
Expand All @@ -29,12 +28,6 @@
import jax
import jax.numpy as jnp

# pylint: disable=g-import-not-at-top
if sys.version_info < (3, 8):
from typing_extensions import Protocol
else:
from typing import Protocol
# pylint: enable=g-import-not-at-top

T = TypeVar("T")

Expand Down
3 changes: 1 addition & 2 deletions haiku/_src/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

import abc
import typing
from typing import Any, Callable, Mapping, MutableMapping, Sequence
from typing import Any, Callable, Mapping, MutableMapping, Sequence, Protocol, runtime_checkable

import jax
from typing_extensions import Protocol, runtime_checkable # pylint: disable=multiple-statements,g-multiple-import

# pytype: disable=module-attr
try:
Expand Down

0 comments on commit 8d3b4e1

Please sign in to comment.