2020-10-04 01:39:44 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, anyio
|
|
|
|
, asyncio-throttle
|
|
|
|
, dataclasses
|
|
|
|
, ircstates
|
|
|
|
, async_stagger
|
|
|
|
, async-timeout
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ircrobots";
|
2020-12-02 15:21:00 +00:00
|
|
|
version = "0.3.6";
|
2020-10-04 01:39:44 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jesopo";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-12-02 15:21:00 +00:00
|
|
|
sha256 = "1c8h8b78gmnfipppr9dxp7sl6wd9lx4l3pdwykaib1f49dqwavys";
|
2020-10-04 01:39:44 +01:00
|
|
|
};
|
|
|
|
|
2020-11-18 03:00:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
# too specific pins https://github.com/jesopo/ircrobots/issues/3
|
2020-12-02 15:21:00 +00:00
|
|
|
sed -iE 's/anyio.*/anyio/' requirements.txt
|
2020-11-18 03:00:21 +00:00
|
|
|
'';
|
2020-10-04 01:39:44 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|