diff --git a/pkgs/development/python-modules/cloudpickle/default.nix b/pkgs/development/python-modules/cloudpickle/default.nix new file mode 100644 index 000000000000..b7c79bbc2827 --- /dev/null +++ b/pkgs/development/python-modules/cloudpickle/default.nix @@ -0,0 +1,27 @@ +{ stdenv, buildPythonPackage, fetchPypi, pytest, mock }: + +buildPythonPackage rec { + pname = "cloudpickle"; + version = "0.2.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "0x4fbycipkhfax7lydaxcnc14g42g274qba17j51shr5gbq6m8lx"; + }; + + buildInputs = [ pytest mock ]; + + # See README for tests invocation + checkPhase = '' + PYTHONPATH=$PYTHONPATH:'.:tests' py.test + ''; + + # TypeError: cannot serialize '_io.FileIO' object + doCheck = false; + + meta = with stdenv.lib; { + description = "Extended pickling support for Python objects"; + homepage = https://github.com/cloudpipe/cloudpickle; + license = with licenses; [ bsd3 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 122e9947928d..404555430cbd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1574,31 +1574,7 @@ in { }; }; - cloudpickle = buildPythonPackage rec { - name = "cloudpickle-${version}"; - version = "0.2.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/c/cloudpickle/${name}.tar.gz"; - sha256 = "0x4fbycipkhfax7lydaxcnc14g42g274qba17j51shr5gbq6m8lx"; - }; - - buildInputs = with self; [ pytest mock ]; - - # See README for tests invocation - checkPhase = '' - PYTHONPATH=$PYTHONPATH:'.:tests' py.test - ''; - - # TypeError: cannot serialize '_io.FileIO' object - doCheck = false; - - meta = { - description = "Extended pickling support for Python objects"; - homepage = https://github.com/cloudpipe/cloudpickle; - license = with licenses; [ bsd3 ]; - }; - }; + cloudpickle = callPackage ../development/python-modules/cloudpickle { }; cmdline = buildPythonPackage rec { pname = "cmdline";