summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-04-14 00:54:07 +0200
committerGitHub <noreply@github.com>2021-04-14 00:54:07 +0200
commit0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb (patch)
tree27a22be83e7ac8f1b6ca901687f1a1589715a846
parent71e2a4f48b3069bf306aad2cd481872f244d9f4b (diff)
parenta3c2706c676742958c928f057c9d580f7675945f (diff)
downloadnixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar.gz
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar.bz2
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar.lz
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar.xz
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.tar.zst
nixpkgs-0736e2dd571cbc9ddf8fc4e63edea26b2c96d6fb.zip
Merge pull request #115984 from Luflosi/update/ipfshttpclient
python3Packages.ipfshttpclient: 0.4.2.post1 -> 0.7.0, rename from ipfsapi
-rw-r--r--pkgs/development/python-modules/ipfsapi/default.nix30
-rw-r--r--pkgs/development/python-modules/ipfshttpclient/default.nix82
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 83 insertions, 31 deletions
diff --git a/pkgs/development/python-modules/ipfsapi/default.nix b/pkgs/development/python-modules/ipfsapi/default.nix
deleted file mode 100644
index c97eafb6054..00000000000
--- a/pkgs/development/python-modules/ipfsapi/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, isPy27
-, six
-, requests
-}:
-
-buildPythonPackage {
-  pname = "ipfsapi";
-  version = "0.4.2.post1";
-  disabled = isPy27;
-
-  src = fetchFromGitHub {
-    owner = "ipfs";
-    repo = "py-ipfs-api";
-    rev = "0c485544a114f580c65e2ffbb5782efbf7fd9f61";
-    sha256 = "1v7f77cv95yv0v80gisdh71mj7jcq41xcfip6bqm57zfdbsa0xpn";
-  };
-
-  propagatedBuildInputs = [ six requests ];
-
-  meta = with lib; {
-    description = "A python client library for the IPFS API";
-    license = licenses.mit;
-    maintainers = with maintainers; [ mguentner ];
-    homepage = "https://pypi.python.org/pypi/ipfsapi";
-  };
-
-}
diff --git a/pkgs/development/python-modules/ipfshttpclient/default.nix b/pkgs/development/python-modules/ipfshttpclient/default.nix
new file mode 100644
index 00000000000..aec8f1ec117
--- /dev/null
+++ b/pkgs/development/python-modules/ipfshttpclient/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, python
+, py-multiaddr
+, requests
+, pytestCheckHook
+, pytest-cov
+, pytest-dependency
+, pytest-localserver
+, pytest-mock
+, pytest-order
+, pytest-cid
+, mock
+, ipfs
+, httpx
+, httpcore
+}:
+
+buildPythonPackage rec {
+  pname = "ipfshttpclient";
+  version = "0.7.0";
+  format = "flit";
+  disabled = pythonOlder "3.5";
+
+  src = fetchFromGitHub {
+    owner = "ipfs-shipyard";
+    repo = "py-ipfs-http-client";
+    rev = version;
+    sha256 = "sha256-0lMoZo/9kZUXkaKvD9ZAZDQdGX7eNLzJVszZdlM/3Qs=";
+  };
+
+  propagatedBuildInputs = [
+    py-multiaddr
+    requests
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+    pytest-cov
+    pytest-dependency
+    pytest-localserver
+    pytest-mock
+    pytest-order
+    pytest-cid
+    mock
+    ipfs
+    httpcore
+    httpx
+  ];
+
+  postPatch = ''
+    # Remove when the package supports the latest IPFS version by default
+    substituteInPlace ipfshttpclient/client/__init__.py \
+      --replace 'VERSION_MAXIMUM   = "0.8.0"' \
+                'VERSION_MAXIMUM   = "0.9.0"'
+
+    # Use pytest-order instead of pytest-ordering since the latter is unmaintained and broken
+    substituteInPlace test/run-tests.py \
+      --replace 'pytest_ordering' 'pytest_order'
+    substituteInPlace test/functional/test_miscellaneous.py \
+      --replace '@pytest.mark.last' '@pytest.mark.order("last")'
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    ${python.interpreter} -X utf8 test/run-tests.py
+
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [ "ipfshttpclient" ];
+
+  meta = with lib; {
+    description = "A python client library for the IPFS API";
+    homepage = "https://github.com/ipfs-shipyard/py-ipfs-http-client";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mguentner Luflosi ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d83a12673b5..b8ccf21e388 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -3397,7 +3397,7 @@ in {
 
   ipdbplugin = callPackage ../development/python-modules/ipdbplugin { };
 
-  ipfsapi = callPackage ../development/python-modules/ipfsapi { };
+  ipfshttpclient = callPackage ../development/python-modules/ipfshttpclient { };
 
   iptools = callPackage ../development/python-modules/iptools { };