Skip to content

Commit

Permalink
move ethpm deprecation warning to only show when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Jun 6, 2023
1 parent 0bb65e3 commit 18c8daa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ethpm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import warnings
from pathlib import Path


warnings.warn(
"The ``ethPM`` module is no longer being maintained and will be "
"deprecated with ``web3.py`` version 7",
UserWarning,
)

ETHPM_DIR = Path(__file__).parent
ASSETS_DIR = ETHPM_DIR / "assets"

Expand Down
1 change: 1 addition & 0 deletions newsfragments/2983.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved `ethpm` deprecation warning to only show when the module is explicitly enabled
7 changes: 7 additions & 0 deletions web3/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import decimal
import warnings

from ens import (
AsyncENS,
Expand Down Expand Up @@ -343,6 +344,12 @@ def pm(self) -> "PM":
)

def enable_unstable_package_management_api(self) -> None:
warnings.warn(
"The ``ethPM`` module is no longer being maintained and will be "
"deprecated with ``web3.py`` version 7",
UserWarning,
)

from web3.pm import PM # noqa: F811

if not hasattr(self, "_pm"):
Expand Down

0 comments on commit 18c8daa

Please sign in to comment.