From 80dfc6dc3cc5991ca82668f20028b1f823f43ea7 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 29 Aug 2020 13:09:38 +0200 Subject: [PATCH] python2.pkgs.ujson: use compatible version --- pkgs/development/python-modules/ujson/2.nix | 28 +++++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 +++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/ujson/2.nix diff --git a/pkgs/development/python-modules/ujson/2.nix b/pkgs/development/python-modules/ujson/2.nix new file mode 100644 index 000000000000..e1d1185f6f5e --- /dev/null +++ b/pkgs/development/python-modules/ujson/2.nix @@ -0,0 +1,28 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, setuptools_scm +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "ujson"; + version = "2.0.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "18z9gb9ggy1r464b9q1gqs078mqgrkj6dys5a47529rqk3yfybdx"; + }; + + nativeBuildInputs = [ setuptools_scm ]; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with stdenv.lib; { + homepage = "https://pypi.python.org/pypi/ujson"; + description = "Ultra fast JSON encoder and decoder for Python"; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3e43854afd20..e3148fbaaa4f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6993,7 +6993,9 @@ in { carbon = callPackage ../development/python-modules/carbon { }; - ujson = callPackage ../development/python-modules/ujson { }; + ujson = if isPy27 + then callPackage ../development/python-modules/ujson/2.nix { } + else callPackage ../development/python-modules/ujson { }; unidecode = callPackage ../development/python-modules/unidecode {}; @@ -7853,7 +7855,7 @@ in { rxv = callPackage ../development/python-modules/rxv { }; userpath = callPackage ../development/python-modules/userpath { }; - + pooch = callPackage ../development/python-modules/pooch {}; });