Skip to content

Commit 18c8daa

Browse files
committed
move ethpm deprecation warning to only show when enabled
1 parent 0bb65e3 commit 18c8daa

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

ethpm/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
import warnings
21
from pathlib import Path
32

43

5-
warnings.warn(
6-
"The ``ethPM`` module is no longer being maintained and will be "
7-
"deprecated with ``web3.py`` version 7",
8-
UserWarning,
9-
)
10-
114
ETHPM_DIR = Path(__file__).parent
125
ASSETS_DIR = ETHPM_DIR / "assets"
136

newsfragments/2983.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Moved `ethpm` deprecation warning to only show when the module is explicitly enabled

web3/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import decimal
2+
import warnings
23

34
from ens import (
45
AsyncENS,
@@ -343,6 +344,12 @@ def pm(self) -> "PM":
343344
)
344345

345346
def enable_unstable_package_management_api(self) -> None:
347+
warnings.warn(
348+
"The ``ethPM`` module is no longer being maintained and will be "
349+
"deprecated with ``web3.py`` version 7",
350+
UserWarning,
351+
)
352+
346353
from web3.pm import PM # noqa: F811
347354

348355
if not hasattr(self, "_pm"):

0 commit comments

Comments
 (0)