summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2020-10-30 22:41:05 +0100
committerGitHub <noreply@github.com>2020-10-30 22:41:05 +0100
commit5a22c6f167f5e7800710772e3ddb6d98cf7c191d (patch)
tree2c01aea148e0f386c3d6604e507ba9919e701c5b
parent4221de2b4f88bb5a76c98c0ec6d40c1047315a06 (diff)
parentf31f1020bc9b823dc54d8c5018c4e0454f5fe0c3 (diff)
downloadnixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar.gz
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar.bz2
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar.lz
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar.xz
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.tar.zst
nixpkgs-5a22c6f167f5e7800710772e3ddb6d98cf7c191d.zip
Merge pull request #99521 from mweinelt/irc-stuff
python3Packages.{irctokens,ircstates,ircrobots}: init
-rw-r--r--pkgs/development/python-modules/anyio/default.nix58
-rw-r--r--pkgs/development/python-modules/async_stagger/default.nix44
-rw-r--r--pkgs/development/python-modules/asyncio-throttle/default.nix34
-rw-r--r--pkgs/development/python-modules/ircrobots/default.nix52
-rw-r--r--pkgs/development/python-modules/ircrobots/relax-dependencies.patch14
-rw-r--r--pkgs/development/python-modules/ircstates/default.nix48
-rw-r--r--pkgs/development/python-modules/irctokens/default.nix34
-rw-r--r--pkgs/top-level/python-packages.nix12
8 files changed, 296 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/anyio/default.nix b/pkgs/development/python-modules/anyio/default.nix
new file mode 100644
index 00000000000..516b8520f00
--- /dev/null
+++ b/pkgs/development/python-modules/anyio/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, idna
+, sniffio
+, typing-extensions
+, curio
+, hypothesis
+, pytestCheckHook
+, trio
+, trustme
+, uvloop
+}:
+
+buildPythonPackage rec {
+  pname = "anyio";
+  version = "2.0.2";
+  format = "pyproject";
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "agronholm";
+    repo = pname;
+    rev = version;
+    sha256 = "06nazfrm2sclp3lpgsn9wl8vmqxvx36s3gr2gnqz3zhjpf3glkxv";
+  };
+
+  propagatedBuildInputs = [
+    idna
+    sniffio
+  ] ++ lib.optionals (pythonOlder "3.8") [
+    typing-extensions
+  ];
+
+  checkInputs = [
+    curio
+    hypothesis
+    pytestCheckHook
+    trio
+    trustme
+    uvloop
+  ];
+
+  pytestFlagsArray = [
+    # lots of DNS lookups
+    "--ignore=tests/test_sockets.py"
+  ];
+
+  pythonImportsCheck = [ "anyio" ];
+
+  meta = with lib; {
+    description = "High level compatibility layer for multiple asynchronous event loop implementations on Python";
+    homepage = "https://github.com/agronholm/anyio";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/development/python-modules/async_stagger/default.nix b/pkgs/development/python-modules/async_stagger/default.nix
new file mode 100644
index 00000000000..034a8329b12
--- /dev/null
+++ b/pkgs/development/python-modules/async_stagger/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, fetchpatch
+, pythonOlder
+, pytestCheckHook
+, pytest-asyncio
+, pytest-mock
+}:
+
+buildPythonPackage rec {
+  pname = "async_stagger";
+  version = "0.3.0";
+  disabled = pythonOlder "3.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "007l54fbk2dfzv3vmqz98m1i37mzxkkva5r4fiwq2pg8nb61fy0w";
+  };
+
+  patches = [
+    (fetchpatch {
+      # Fix test failures on Python 3.8
+      # https://github.com/twisteroidambassador/async_stagger/issues/4
+      url = "https://github.com/twisteroidambassador/async_stagger/commit/736ab20ff9c172628d911f1e6f72420399ec9631.patch";
+      sha256 = "1ygqd9n56sj83lvgmv6nrx3m0sp3646s5k7z697qx43xslixj731";
+    })
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+    pytest-asyncio
+    pytest-mock
+  ];
+
+  pythonImportsCheck = [ "async_stagger" ];
+
+  meta = with lib; {
+    description = "Happy Eyeballs connection algorithm and underlying scheduling logic in asyncio";
+    homepage = "https://github.com/twisteroidambassador/async_stagger";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/development/python-modules/asyncio-throttle/default.nix b/pkgs/development/python-modules/asyncio-throttle/default.nix
new file mode 100644
index 00000000000..bf08aec41a5
--- /dev/null
+++ b/pkgs/development/python-modules/asyncio-throttle/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, pytestCheckHook
+, pytest-asyncio
+}:
+
+buildPythonPackage rec {
+  pname = "asyncio-throttle";
+  version = "1.0.1";
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "hallazzang";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0raqnrnp42cn1c7whbm7ajbgaczx33k6hbxsj30nh998pqxhh4sj";
+  };
+
+  checkInputs = [
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [ "asyncio_throttle" ];
+
+  meta = with lib; {
+    description = "Simple, easy-to-use throttler for asyncio";
+    homepage = "https://github.com/hallazzang/asyncio-throttle";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/development/python-modules/ircrobots/default.nix b/pkgs/development/python-modules/ircrobots/default.nix
new file mode 100644
index 00000000000..359cf3e6934
--- /dev/null
+++ b/pkgs/development/python-modules/ircrobots/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, anyio
+, asyncio-throttle
+, dataclasses
+, ircstates
+, async_stagger
+, async-timeout
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "ircrobots";
+  version = "0.3.3";
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "jesopo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0ykn6ch7aazv2cx13q2gr94arh6f96d8hwjwnrcjai3i3x4q2pkq";
+  };
+
+  patches = [
+    ./relax-dependencies.patch
+  ];
+
+  propagatedBuildInputs = [
+    anyio
+    asyncio-throttle
+    ircstates
+    async_stagger
+    async-timeout
+  ] ++ lib.optionals (pythonOlder "3.7") [
+    dataclasses
+  ];
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest test
+  '';
+
+  pythonImportsCheck = [ "ircrobots" ];
+
+  meta = with lib; {
+    description = "Asynchronous bare-bones IRC bot framework for python3";
+    license = licenses.mit;
+    homepage = "https://github.com/jesopo/ircrobots";
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/development/python-modules/ircrobots/relax-dependencies.patch b/pkgs/development/python-modules/ircrobots/relax-dependencies.patch
new file mode 100644
index 00000000000..9aed3577f63
--- /dev/null
+++ b/pkgs/development/python-modules/ircrobots/relax-dependencies.patch
@@ -0,0 +1,14 @@
+diff --git a/requirements.txt b/requirements.txt
+index 87a2d31..4e0efb1 100644
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -1,6 +1,6 @@
+-anyio            ==1.3.0
++anyio
+ asyncio-throttle ==1.0.1
+-dataclasses      ==0.6
+-ircstates        ==0.11.2
++dataclasses; python_version < "3.7"
++ircstates        >=0.11.2
+ async_stagger    ==0.3.0
+ async_timeout    ==3.0.1
diff --git a/pkgs/development/python-modules/ircstates/default.nix b/pkgs/development/python-modules/ircstates/default.nix
new file mode 100644
index 00000000000..857b0358aff
--- /dev/null
+++ b/pkgs/development/python-modules/ircstates/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, fetchpatch
+, pythonOlder
+, irctokens
+, pendulum
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "ircstates";
+  version = "0.11.3";
+  disabled = pythonOlder "3.6";  # f-strings
+
+  src = fetchFromGitHub {
+    owner = "jesopo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1v8r6ma8gzvn5ym3xx9qlb0rc4l67pxr3z8njzk1ffxn1x3mxd3i";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "relax-pendulum-version.patch";
+      url = "https://github.com/jesopo/ircstates/commit/f51f1b689e592020d1c91ccab6c03927aadb9f94.patch";
+      sha256 = "0qbp3b9hlqbbx7b474q1mcgnzzzwcm4g89x26iqgmlgxzmv3y5xp";
+    })
+  ];
+
+  propagatedBuildInputs = [
+    irctokens
+    pendulum
+  ];
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest test
+  '';
+
+  pythonImportsCheck = [ "ircstates" ];
+
+  meta = with lib; {
+    description = "sans-I/O IRC session state parsing library";
+    license = licenses.mit;
+    homepage = "https://github.com/jesopo/ircstates";
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/development/python-modules/irctokens/default.nix b/pkgs/development/python-modules/irctokens/default.nix
new file mode 100644
index 00000000000..037a5f0520f
--- /dev/null
+++ b/pkgs/development/python-modules/irctokens/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, pyyaml
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "irctokens";
+  version = "2.0.0";
+  disabled = pythonOlder "3.6";  # f-strings
+
+  src = fetchFromGitHub {
+    owner = "jesopo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0kpxn5paailm4xpdlnzxrhjrfgvvg5pp327wd8kl41a0wbqkj4zb";
+  };
+
+  checkInputs = [ pyyaml ];
+  checkPhase = ''
+    ${python.interpreter} -m unittest test
+  '';
+
+  pythonImportsCheck = [ "irctokens" ];
+
+  meta = with lib; {
+    description = "RFC1459 and IRCv3 protocol tokeniser library for python3";
+    license = licenses.mit;
+    homepage = "https://github.com/jesopo/irctokens";
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index c93931fe0ab..7326f6194ea 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -322,6 +322,8 @@ in {
 
   antlr4-python3-runtime = callPackage ../development/python-modules/antlr4-python3-runtime { antlr4 = pkgs.antlr4; };
 
+  anyio = callPackage ../development/python-modules/anyio { };
+
   anyjson = callPackage ../development/python-modules/anyjson { };
 
   anytree = callPackage ../development/python-modules/anytree { inherit (pkgs) graphviz; };
@@ -426,10 +428,14 @@ in {
 
   async_generator = callPackage ../development/python-modules/async_generator { };
 
+  asyncio-throttle = callPackage ../development/python-modules/asyncio-throttle { };
+
   asyncpg = callPackage ../development/python-modules/asyncpg { };
 
   asyncssh = callPackage ../development/python-modules/asyncssh { };
 
+  async_stagger = callPackage ../development/python-modules/async_stagger { };
+
   asynctest = callPackage ../development/python-modules/asynctest { };
 
   async-timeout = callPackage ../development/python-modules/async_timeout { };
@@ -2985,6 +2991,12 @@ in {
 
   irc = callPackage ../development/python-modules/irc { };
 
+  ircrobots = callPackage ../development/python-modules/ircrobots { };
+
+  ircstates = callPackage ../development/python-modules/ircstates { };
+
+  irctokens = callPackage ../development/python-modules/irctokens { };
+
   isbnlib = callPackage ../development/python-modules/isbnlib { };
 
   islpy = callPackage ../development/python-modules/islpy { };