From f0ac8236968eb5a38a5f0cd21b014a8fe8715e56 Mon Sep 17 00:00:00 2001 From: wisut hantanong Date: Sat, 15 Jul 2017 16:19:34 +0700 Subject: [PATCH] python.pkgs.intervaltree: move to separate expression --- .../python-modules/intervaltree/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 25 +------------- 2 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/intervaltree/default.nix diff --git a/pkgs/development/python-modules/intervaltree/default.nix b/pkgs/development/python-modules/intervaltree/default.nix new file mode 100644 index 000000000000..69b35df29738 --- /dev/null +++ b/pkgs/development/python-modules/intervaltree/default.nix @@ -0,0 +1,33 @@ +{ stdenv, buildPythonPackage, fetchPypi +, python, pytest, sortedcontainers }: + +buildPythonPackage rec { + version = "2.1.0"; + pname = "intervaltree"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "02w191m9zxkcjqr1kv2slxvhymwhj3jnsyy3a28b837pi15q19dc"; + }; + + buildInputs = [ pytest ]; + + propagatedBuildInputs = [ sortedcontainers ]; + + checkPhase = '' + runHook preCheck + # pytest will try to run tests for nix_run_setup.py / files in build/lib which fails + mv nix_run_setup.py run_setup + rm build -rf + ${python.interpreter} run_setup test + runHook postCheck + ''; + + meta = with stdenv.lib; { + description = "Editable interval tree data structure for Python 2 and 3"; + homepage = https://github.com/chaimleib/intervaltree; + license = [ licenses.asl20 ]; + maintainers = [ maintainers.bennofs ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e1a295d56ed4..00fb06ae1da3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -29867,30 +29867,7 @@ EOF }; }; - intervaltree = buildPythonPackage rec { - name = "intervaltree-${version}"; - version = "2.1.0"; - src = pkgs.fetchurl { - url = "mirror://pypi/i/intervaltree/${name}.tar.gz"; - sha256 = "02w191m9zxkcjqr1kv2slxvhymwhj3jnsyy3a28b837pi15q19dc"; - }; - buildInputs = with self; [ pytest ]; - propagatedBuildInputs = with self; [ sortedcontainers ]; - checkPhase = '' - runHook preCheck - # pytest will try to run tests for nix_run_setup.py / files in build/lib which fails - mv nix_run_setup.py run_setup - rm build -rf - ${python.interpreter} run_setup test - runHook postCheck - ''; - meta = with pkgs.stdenv.lib; { - description = "Editable interval tree data structure for Python 2 and 3"; - homepage = https://github.com/chaimleib/intervaltree; - license = [ licenses.asl20 ]; - maintainers = [ maintainers.bennofs ]; - }; - }; + intervaltree = callPackage ../development/python-modules/intervaltree { }; packaging = callPackage ../development/python-modules/packaging { };