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

[Dependencies] Remove typing_extensions #40336

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 0 additions & 1 deletion doc/source/ray-overview/pip_freeze_ray-ml-py39-cpu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ triton==2.0.0
tune-sklearn @ git+https://github.com/ray-project/tune-sklearn@6e813e18fb43156d32f0958794881c7c12d14f17
typeguard==2.13.3
typer==0.9.0
typing_extensions==4.5.0
tzdata==2023.3
uri-template==1.3.0
uritemplate==3.0.1
Expand Down
1 change: 0 additions & 1 deletion doc/source/ray-overview/pip_freeze_ray-py39-cpu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ tensorboardX==2.6
tifffile==2023.7.10
tqdm @ file:///croot/tqdm_1679561862951/work
typer==0.9.0
typing_extensions==4.5.0
tzdata==2023.3
uritemplate==3.0.1
urllib3 @ file:///croot/urllib3_1686163155763/work
Expand Down
5 changes: 1 addition & 4 deletions python/ray/_private/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
import colorama
import setproctitle

if sys.version_info >= (3, 8):
from typing import Literal, Protocol
else:
from typing_extensions import Literal, Protocol
from typing import Literal, Protocol

import ray
import ray._private.node
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import collections
import os
import sys
import time
from dataclasses import dataclass
from typing import (
Expand Down Expand Up @@ -30,10 +29,7 @@
except ImportError:
resource = None

if sys.version_info >= (3, 8):
from typing import Literal, Protocol
else:
from typing_extensions import Literal, Protocol
from typing import Literal, Protocol

if TYPE_CHECKING:
import pandas
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import html
import itertools
import logging
import sys
import time
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -131,10 +130,7 @@
from ray.widgets import Template
from ray.widgets.util import repr_with_fallback

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

if TYPE_CHECKING:
import dask
Expand Down
5 changes: 1 addition & 4 deletions python/ray/data/datasource/file_based_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
)
from ray.util.annotations import DeveloperAPI, PublicAPI

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

if TYPE_CHECKING:
import pandas as pd
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/datasource/file_metadata_shuffler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import sys
from typing import Any, List, Union

import numpy as np

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal


class FileMetadataShuffler:
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/datasource/parquet_datasource.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import sys
from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Union

import numpy as np
Expand All @@ -23,10 +22,7 @@
from ray.data.datasource.parquet_base_datasource import ParquetBaseDatasource
from ray.util.annotations import PublicAPI

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

if TYPE_CHECKING:
import pyarrow
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/preprocessors/batch_mapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import warnings
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union

Expand All @@ -8,10 +7,7 @@
from ray.data.preprocessor import Preprocessor
from ray.util.annotations import Deprecated

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

if TYPE_CHECKING:
import pandas
Expand Down
6 changes: 1 addition & 5 deletions python/ray/data/read_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import math
import os
import sys
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -87,10 +86,7 @@
from ray.util.placement_group import PlacementGroup
from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

if TYPE_CHECKING:
import dask
Expand Down
6 changes: 1 addition & 5 deletions python/ray/train/_internal/data_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from typing import Dict, List, Optional, Union

import ray
Expand All @@ -10,10 +9,7 @@
from ray.train.constants import TRAIN_DATASET_KEY # noqa
from ray.util.annotations import DeveloperAPI, PublicAPI

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal


@PublicAPI(stability="stable")
Expand Down
7 changes: 1 addition & 6 deletions python/ray/util/state/custom_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

from ray.core.generated.common_pb2 import (
TaskStatus,
TaskType,
Expand All @@ -13,10 +11,7 @@
)
from ray.dashboard.memory_utils import ReferenceType

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal


ACTOR_STATUS = [
Expand Down
1 change: 0 additions & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ grpcio == 1.54.2; sys_platform == "darwin"
grpcio >= 1.54.2; sys_platform != "darwin"
numpy>=1.16; python_version < '3.9'
numpy>=1.19.3; python_version >= '3.9'
typing_extensions; python_version < '3.8'

pyarrow >= 6.0.1; platform_system != "Windows"
pyarrow >= 6.0.1, < 7.0.0; platform_system == "Windows"
Expand Down
3 changes: 0 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@ def get_packages(self):
"aiosignal",
"frozenlist",
"requests",
# Light weight requirement, can be replaced with "typing" once
# we deprecate Python 3.7 (this will take a while).
"typing_extensions; python_version < '3.8'",
]


Expand Down
6 changes: 1 addition & 5 deletions release/nightly_tests/dataset/iter_batches_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import sys
from typing import Optional

import ray
from ray.data.dataset import Dataset

from benchmark import Benchmark

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal


def iter_batches(
Expand Down
6 changes: 1 addition & 5 deletions release/nightly_tests/dataset/map_batches_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from typing import Optional, Union
import numpy as np

Expand All @@ -8,10 +7,7 @@

from benchmark import Benchmark

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal


def map_batches(
Expand Down
2 changes: 1 addition & 1 deletion release/ray_release/configs/global_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import yaml
from typing_extensions import TypedDict
from typing import TypedDict


class GlobalConfig(TypedDict):
Expand Down
Loading