Skip to content

Commit 07ce7d8

Browse files
Package now uses importlib.metadata instead of pkg_resources
1 parent 34c7601 commit 07ce7d8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

turftopic/serialization.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
22
import warnings
3+
from importlib.metadata import version
34
from pathlib import Path
45
from typing import Union
56

67
import joblib
7-
import pkg_resources
88
from huggingface_hub import snapshot_download
99

1010
IMPORTANT_PACKAGES = [
@@ -61,10 +61,7 @@
6161

6262

6363
def get_package_versions() -> dict[str, str]:
64-
return {
65-
package: pkg_resources.get_distribution(package).version
66-
for package in IMPORTANT_PACKAGES
67-
}
64+
return {package: version(package) for package in IMPORTANT_PACKAGES}
6865

6966

7067
def validate_package_versions(remote_versions: dict[str, str]):

0 commit comments

Comments
 (0)