From 1ab1ff496354cc7d27d669bc50a05bb076d88ae7 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 29 Oct 2018 11:42:54 -0400 Subject: [PATCH] pythonPackages.txrequests: refactor move to python-modules --- .../python-modules/txrequests/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 24 +------------ 2 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 pkgs/development/python-modules/txrequests/default.nix diff --git a/pkgs/development/python-modules/txrequests/default.nix b/pkgs/development/python-modules/txrequests/default.nix new file mode 100644 index 000000000000..c1d98738b562 --- /dev/null +++ b/pkgs/development/python-modules/txrequests/default.nix @@ -0,0 +1,35 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, twisted +, requests +, cryptography +, python +}: + +buildPythonPackage rec { + pname = "txrequests"; + version = "0.9.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "0kkxxd17ar5gyjkz9yrrdr15a64qw6ym60ndi0zbwx2s634yfafw"; + }; + + propagatedBuildInputs = [ twisted requests cryptography ]; + + # Require network access + doCheck = false; + + checkPhase = '' + ${python.interpreter} -m unittest discover + ''; + + meta = with stdenv.lib; { + description = "Asynchronous Python HTTP for Humans."; + homepage = "https://github.com/tardyp/txrequests"; + license = licenses.asl20; + maintainers = with maintainers; [ nand0p ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ecf6429fd4cf..91d3d0830685 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4290,29 +4290,7 @@ in { txgithub = callPackage ../development/python-modules/txgithub { }; - txrequests = buildPythonPackage rec { - name = "${pname}-${version}"; - pname = "txrequests"; - version = "0.9.2"; - src = pkgs.fetchurl { - url = "mirror://pypi/t/${pname}/${name}.tar.gz"; - sha256 = "0kkxxd17ar5gyjkz9yrrdr15a64qw6ym60ndi0zbwx2s634yfafw"; - }; - propagatedBuildInputs = with self; [ twisted requests cryptography ]; - - # Require network access - doCheck = false; - checkPhase = '' - ${python.interpreter} -m unittest discover - ''; - meta = { - description = "Asynchronous Python HTTP for Humans."; - homepage = "https://github.com/tardyp/txrequests"; - license = licenses.asl20; - maintainers = with maintainers; [ nand0p ]; - platforms = platforms.all; - }; - }; + txrequests = callPackage ../development/python-modules/txrequests { }; txamqp = buildPythonPackage rec { name = "txamqp-${version}";