diff --git a/pkgs/development/python-modules/tornado/4.nix b/pkgs/development/python-modules/tornado/4.nix new file mode 100644 index 000000000000..6d889a09d25e --- /dev/null +++ b/pkgs/development/python-modules/tornado/4.nix @@ -0,0 +1,37 @@ +{ lib +, python +, buildPythonPackage +, fetchPypi +, backports_abc +, backports_ssl_match_hostname +, certifi +, singledispatch +, futures +, isPy27 +}: + +buildPythonPackage rec { + pname = "tornado"; + version = "4.5.3"; + + propagatedBuildInputs = lib.optionals isPy27 [ backports_abc certifi singledispatch backports_ssl_match_hostname futures ]; + + # 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 { + inherit pname version; + sha256 = "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d"; + }; + + __darwinAllowLocalNetworking = true; + + meta = { + description = "A web framework and asynchronous networking library"; + homepage = "https://www.tornadoweb.org/"; + license = lib.licenses.asl20; + }; +} diff --git a/pkgs/development/python-modules/tornado/5.nix b/pkgs/development/python-modules/tornado/5.nix new file mode 100644 index 000000000000..da270331978d --- /dev/null +++ b/pkgs/development/python-modules/tornado/5.nix @@ -0,0 +1,37 @@ +{ lib +, python +, buildPythonPackage +, fetchPypi +, backports_abc +, backports_ssl_match_hostname +, certifi +, singledispatch +, futures +, isPy27 +}: + +buildPythonPackage rec { + pname = "tornado"; + version = "5.1.1"; + + propagatedBuildInputs = lib.optionals isPy27 [ backports_abc certifi singledispatch backports_ssl_match_hostname futures ]; + + # 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 { + inherit pname version; + sha256 = "4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409"; + }; + + __darwinAllowLocalNetworking = true; + + meta = { + description = "A web framework and asynchronous networking library"; + homepage = "https://www.tornadoweb.org/"; + license = lib.licenses.asl20; + }; +} diff --git a/pkgs/development/python-modules/tornado/default.nix b/pkgs/development/python-modules/tornado/default.nix index 102cf0fed574..8d9cadeb3e54 100644 --- a/pkgs/development/python-modules/tornado/default.nix +++ b/pkgs/development/python-modules/tornado/default.nix @@ -2,35 +2,11 @@ , python , buildPythonPackage , fetchPypi -, backports_abc -, backports_ssl_match_hostname -, certifi -, singledispatch -, pythonOlder -, futures -, version ? "5.1" }: -let - versionMap = { - "4.5.3" = { - sha256 = "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d"; - }; - "5.1" = { - sha256 = "4f66a2172cb947387193ca4c2c3e19131f1c70fa8be470ddbbd9317fd0801582"; - }; - }; -in - -with versionMap.${version}; - buildPythonPackage rec { pname = "tornado"; - inherit version; - - propagatedBuildInputs = [ backports_abc certifi singledispatch ] - ++ lib.optional (pythonOlder "3.5") backports_ssl_match_hostname - ++ lib.optional (pythonOlder "3.2") futures; + version = "6.0.4"; # We specify the name of the test files to prevent # https://github.com/NixOS/nixpkgs/issues/14634 @@ -39,14 +15,15 @@ buildPythonPackage rec { ''; src = fetchPypi { - inherit pname sha256 version; + inherit pname version; + sha256 = "0fe2d45ba43b00a41cd73f8be321a44936dc1aba233dee979f17a042b83eb6dc"; }; __darwinAllowLocalNetworking = true; meta = { description = "A web framework and asynchronous networking library"; - homepage = "http://www.tornadoweb.org/"; + homepage = "https://www.tornadoweb.org/"; license = lib.licenses.asl20; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c75b84e8ede7..9a3196b1f2f6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6641,8 +6641,12 @@ in { cmdtest = callPackage ../development/python-modules/cmdtest { }; - tornado = callPackage ../development/python-modules/tornado { }; - tornado_4 = callPackage ../development/python-modules/tornado { version = "4.5.3"; }; + tornado = if isPy3k then + callPackage ../development/python-modules/tornado { } + else + callPackage ../development/python-modules/tornado/5.nix { }; + + tornado_4 = callPackage ../development/python-modules/tornado/4.nix { }; tokenlib = callPackage ../development/python-modules/tokenlib { };