2017-07-28 16:47:39 +02:00
|
|
|
{ lib
|
|
|
|
, python
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, backports_abc
|
|
|
|
, backports_ssl_match_hostname
|
|
|
|
, certifi
|
|
|
|
, singledispatch
|
2018-01-24 14:00:42 +01:00
|
|
|
, pythonOlder
|
2018-04-04 20:17:46 +02:00
|
|
|
, futures
|
2018-09-15 10:09:36 +02:00
|
|
|
, version ? "5.1"
|
2017-07-28 16:47:39 +02:00
|
|
|
}:
|
|
|
|
|
2018-09-15 10:09:36 +02:00
|
|
|
let
|
|
|
|
versionMap = {
|
|
|
|
"4.5.3" = {
|
|
|
|
sha256 = "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d";
|
|
|
|
};
|
|
|
|
"5.1" = {
|
|
|
|
sha256 = "4f66a2172cb947387193ca4c2c3e19131f1c70fa8be470ddbbd9317fd0801582";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
with versionMap.${version};
|
|
|
|
|
2017-07-28 16:47:39 +02:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tornado";
|
2018-09-15 10:09:36 +02:00
|
|
|
inherit version;
|
2017-07-28 16:47:39 +02:00
|
|
|
|
2018-01-24 14:00:42 +01:00
|
|
|
propagatedBuildInputs = [ backports_abc certifi singledispatch ]
|
2018-04-04 20:17:46 +02:00
|
|
|
++ lib.optional (pythonOlder "3.5") backports_ssl_match_hostname
|
|
|
|
++ lib.optional (pythonOlder "3.2") futures;
|
2017-07-28 16:47:39 +02:00
|
|
|
|
|
|
|
# We specify the name of the test files to prevent
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/14634
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover *_test.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchPypi {
|
2018-09-15 10:09:36 +02:00
|
|
|
inherit pname sha256 version;
|
2018-04-04 20:17:46 +02:00
|
|
|
};
|
|
|
|
|
2019-02-12 23:54:54 +01:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2018-04-04 20:17:46 +02:00
|
|
|
meta = {
|
|
|
|
description = "A web framework and asynchronous networking library";
|
|
|
|
homepage = http://www.tornadoweb.org/;
|
|
|
|
license = lib.licenses.asl20;
|
2017-07-28 16:47:39 +02:00
|
|
|
};
|
|
|
|
}
|