From 30bc90828c97da3ee47948fd9f424f5501e77027 Mon Sep 17 00:00:00 2001 From: fselmo Date: Tue, 22 Nov 2022 13:55:14 -0700 Subject: [PATCH] Make ``ipfshhtpclient`` an optional library / backend for ethpm --- docs/ethpm.rst | 11 ++++++++++- setup.py | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/ethpm.rst b/docs/ethpm.rst index 884edc5911..1e783b7c4a 100644 --- a/docs/ethpm.rst +++ b/docs/ethpm.rst @@ -169,7 +169,16 @@ BaseURIBackend IPFS ~~~~ -``Py-EthPM`` has multiple backends available to fetch/pin files to IPFS. The desired backend can be set via the environment variable: ``ETHPM_IPFS_BACKEND_CLASS``. +``Py-EthPM`` has multiple backends available to fetch/pin files to IPFS. +The IPFS backends rely on the now-unmaintained ``ipfshttpclient`` library. Because of +this, they are opt-in and may be installed via the ``ipfs`` web3 install extra. + +.. code-block:: bash + + $ pip install "web3[ipfs]" + + +The desired backend can be set via the environment variable: ``ETHPM_IPFS_BACKEND_CLASS``. - ``InfuraIPFSBackend`` (default) - `https://ipfs.infura.io` diff --git a/setup.py b/setup.py index 3dfaecf1d0..c6bbb87f3b 100644 --- a/setup.py +++ b/setup.py @@ -51,12 +51,16 @@ "pluggy==0.13.1", "when-changed>=0.3.0", ], + "ipfs": [ + "ipfshttpclient==0.8.0a2", + ], } extras_require["dev"] = ( extras_require["tester"] + extras_require["linter"] + extras_require["docs"] + + extras_require["ipfs"] + extras_require["dev"] ) @@ -82,7 +86,6 @@ "eth-typing>=3.0.0", "eth-utils>=2.0.0", "hexbytes>=0.1.0", - "ipfshttpclient==0.8.0a2", "jsonschema>=4.0.0", "lru-dict>=1.1.6", "protobuf>=4.21.6",