From f31f1020bc9b823dc54d8c5018c4e0454f5fe0c3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Oct 2020 02:39:44 +0200 Subject: [PATCH] python3Packages.ircrobots: init at 0.3.3 --- .../python-modules/ircrobots/default.nix | 52 +++++++++++++++++++ .../ircrobots/relax-dependencies.patch | 14 +++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/ircrobots/default.nix create mode 100644 pkgs/development/python-modules/ircrobots/relax-dependencies.patch diff --git a/pkgs/development/python-modules/ircrobots/default.nix b/pkgs/development/python-modules/ircrobots/default.nix new file mode 100644 index 000000000000..359cf3e6934f --- /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 000000000000..9aed3577f63d --- /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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1c8fee71e3e5..e7ee2c82dda8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2971,6 +2971,8 @@ 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 { };