diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 6023397..0a528c5 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -37,7 +37,28 @@ from typing import List as ListType, Dict as DictType, Any as AnyType from typing import Optional, Sequence, Tuple from warnings import warn -from pickleshare import PickleShareDB +try: + from pickleshare import PickleShareDB +except ModuleNotFoundError: + + class PickleShareDB: # type: ignore [no-redef] + def __init__(self, path): + pass + + def get(self, key, default): + warn( + f"using {key} requires you to install the `pickleshare` library.", + stacklevel=2, + ) + return default + + def __setitem__(self, key, value): + warn( + f"using {key} requires you to install the `pickleshare` library.", + stacklevel=2, + ) + + from tempfile import TemporaryDirectory from traitlets import ( Any, diff --git a/setup.cfg b/setup.cfg index 1f558f8..65e6ed6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,6 @@ install_requires = jedi>=0.16 matplotlib-inline pexpect>4.3; sys_platform != "win32" - pickleshare prompt_toolkit>=3.0.30,<3.1.0,!=3.0.37 pygments>=2.4.0 stack_data @@ -76,6 +75,7 @@ test = pytest<7.1 pytest-asyncio testpath + pickleshare test_extra = %(test)s curio