From fb733b5ae79034623b06a61270121a9d3f5ccf56 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 - This change affects the different ipfs backends of ethpm. - Update docs to reference how to install the optional web3 install extra to utilize the ipfs backends. --- docs/ethpm.rst | 11 ++++++++++- newsfragments/2730.breaking.rst | 1 + setup.py | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 newsfragments/2730.breaking.rst 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/newsfragments/2730.breaking.rst b/newsfragments/2730.breaking.rst new file mode 100644 index 0000000000..3134ab911b --- /dev/null +++ b/newsfragments/2730.breaking.rst @@ -0,0 +1 @@ +Make the ``ipfshttpclient`` library opt-in via a web3 install extra. This only affects the ``ethpm`` ``ipfs`` backends, which rely on the library. 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",