Skip to content

Commit 1bb16db

Browse files
kiukchungfacebook-github-bot
authored andcommitted
(torchx/entrypoints) Use importlib.metadata instead of the backported importlib_metadata
Summary: torchx dropped support for python<=3.7 2 years ago (see: #728). But we kept using the backported `importlib_metadata` module to load configurations from `entry_points`. Differential Revision: D77619564
1 parent 7fabab4 commit 1bb16db

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pyre-extensions
22
docstring-parser>=0.8.1
3-
importlib-metadata
43
pyyaml
54
docker
65
filelock

torchx/util/entrypoints.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
# pyre-strict
88

9+
from importlib import metadata
10+
from importlib.metadata import EntryPoint
911
from typing import Any, Dict, Optional
1012

11-
import importlib_metadata as metadata
12-
from importlib_metadata import EntryPoint
13-
1413

1514
# pyre-ignore-all-errors[3, 2]
1615
def load(group: str, name: str, default=None):

torchx/util/test/entrypoints_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
import unittest
1010
from configparser import ConfigParser
11+
12+
from importlib.metadata import EntryPoint, EntryPoints
1113
from types import ModuleType
1214
from typing import List
1315
from unittest.mock import MagicMock, patch
1416

15-
from importlib_metadata import EntryPoint, EntryPoints
16-
1717
from torchx.util.entrypoints import load, load_group
1818

1919

0 commit comments

Comments
 (0)