about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2022-01-16 07:34:26 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2022-01-16 10:00:16 +0100
commitae18d68b6b117528e6cd72325ead36b48562d43f (patch)
tree9f9d765a7208d5d436184dc3656b164fd0581f7f /pkgs/applications/networking/p2p
parent2027fb600d891379c53c4762463e65d040359682 (diff)
python2.pkgs: move expressions into python2-modules/ folder
Another step in further separating python2 from python3.
Diffstat (limited to 'pkgs/applications/networking/p2p')
-rw-r--r--pkgs/applications/networking/p2p/tribler/aiohttp-apispec.nix37
-rw-r--r--pkgs/applications/networking/p2p/tribler/apispec.nix47
-rw-r--r--pkgs/applications/networking/p2p/tribler/default.nix3
3 files changed, 85 insertions, 2 deletions
diff --git a/pkgs/applications/networking/p2p/tribler/aiohttp-apispec.nix b/pkgs/applications/networking/p2p/tribler/aiohttp-apispec.nix
new file mode 100644
index 0000000000000..4e1f5ee6ca70a
--- /dev/null
+++ b/pkgs/applications/networking/p2p/tribler/aiohttp-apispec.nix
@@ -0,0 +1,37 @@
+{ lib, buildPythonPackage, fetchPypi, pythonOlder
+, aiohttp, webargs, fetchFromGitHub, callPackage
+}:
+
+let
+  apispec3 = callPackage ./apispec.nix {};
+  jinja2 = callPackage ../../../../development/python2-modules/jinja2 {};
+in
+buildPythonPackage rec {
+  pname = "aiohttp-apispec";
+  version = "unstable-2021-21-08";
+
+  # unstable so we can use latest webargs
+  src = fetchFromGitHub {
+    owner = "maximdanilchenko";
+    repo = "aiohttp-apispec";
+    rev = "cfa19646394480dda289f6b7af19b7d50f245d81";
+    sha256 = "uEgDRAlMjTa4rvdE3fkORCHIlCLzxPJJ2/m4ZRU3eIQ=";
+    fetchSubmodules = false;
+  };
+
+  propagatedBuildInputs = [ aiohttp webargs apispec3 jinja2 ];
+
+  pythonImportsCheck = [
+    "aiohttp_apispec"
+  ];
+
+  # Requires pytest-sanic, currently broken in nixpkgs
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Build and document REST APIs with aiohttp and apispec";
+    homepage = "https://github.com/maximdanilchenko/aiohttp-apispec/";
+    license = licenses.mit;
+    maintainers = [ maintainers.viric ];
+  };
+}
diff --git a/pkgs/applications/networking/p2p/tribler/apispec.nix b/pkgs/applications/networking/p2p/tribler/apispec.nix
new file mode 100644
index 0000000000000..e60a440df3f4b
--- /dev/null
+++ b/pkgs/applications/networking/p2p/tribler/apispec.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pyyaml
+, prance
+, marshmallow
+, pytestCheckHook
+, mock
+, openapi-spec-validator
+}:
+
+buildPythonPackage rec {
+  pname = "apispec";
+  version = "3.3.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "d23ebd5b71e541e031b02a19db10b5e6d5ef8452c552833e3e1afc836b40b1ad";
+  };
+
+  propagatedBuildInputs = [
+    pyyaml
+    prance
+  ];
+
+  postPatch = ''
+    rm tests/test_ext_marshmallow.py
+  '';
+
+  checkInputs = [
+    openapi-spec-validator
+    marshmallow
+    mock
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "apispec"
+  ];
+
+  meta = with lib; {
+    description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification";
+    homepage = "https://github.com/marshmallow-code/apispec";
+    license = licenses.mit;
+    maintainers = [ maintainers.viric ];
+  };
+}
diff --git a/pkgs/applications/networking/p2p/tribler/default.nix b/pkgs/applications/networking/p2p/tribler/default.nix
index 774aea642d43b..6a8f93a293814 100644
--- a/pkgs/applications/networking/p2p/tribler/default.nix
+++ b/pkgs/applications/networking/p2p/tribler/default.nix
@@ -6,8 +6,7 @@ let
   libtorrent = (python3.pkgs.toPythonModule (
     libtorrent-rasterbar-1_2_x.override { python = python3; })).python;
 
-  aiohttp-apispec = python3.pkgs.callPackage 
-    ../../../../development/python-modules/aiohttp-apispec/unstable.nix { };
+  aiohttp-apispec = python3.pkgs.callPackage ./aiohttp-apispec.nix { };
 in
 stdenv.mkDerivation rec {
   pname = "tribler";