nixpkgs/pkgs/development/python-modules/ircrobots/default.nix
2020-11-17 19:23:17 -08:00

55 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, anyio
, asyncio-throttle
, dataclasses
, ircstates
, async_stagger
, async-timeout
, python
}:
buildPythonPackage rec {
pname = "ircrobots";
version = "0.3.5";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "jesopo";
repo = pname;
rev = "v${version}";
sha256 = "1w04gif227fhzalrds9rscqmckv5h0x2p8600s876i19w41swi32";
};
postPatch = ''
# too specific pins https://github.com/jesopo/ircrobots/issues/3
sed -iE 's/==.*//' requirements.txt
sed -iE 's/dataclasses.*/dataclasses; python_version < "3.7"/' requirements.txt
'';
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 ];
};
}