From e1b6b9056d4001030b65ccea649b75b58c1e77d8 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 21 Oct 2019 08:57:20 -0700 Subject: [PATCH] pythonPackages.lxml: 4.3.3 -> 4.4.1 reduce closure size by not propagating native dependencies --- .../python-modules/lxml/default.nix | 32 +++++++++++-------- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/lxml/default.nix b/pkgs/development/python-modules/lxml/default.nix index f054f26a527..f2cc1663041 100644 --- a/pkgs/development/python-modules/lxml/default.nix +++ b/pkgs/development/python-modules/lxml/default.nix @@ -1,28 +1,34 @@ -{ stdenv -, buildPythonPackage -, fetchPypi +{ stdenv, buildPythonPackage, fetchFromGitHub +, cython , libxml2 , libxslt +, zlib }: buildPythonPackage rec { pname = "lxml"; - version = "4.3.5"; + version = "4.4.1"; - src = fetchPypi { - inherit pname version; - sha256 = "738862e9724d201f1aa8394cb666d8136d666198e97d6e1e5c9876ad884a86b3"; + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "1hkl3bhbwiwwfb57nq9lr24rkp782ymfvqrdf9x1wifc79ivlbxw"; }; - nativeBuildInputs = [ libxml2.dev libxslt.dev ]; - propagatedBuildInputs = [ libxml2 libxslt ]; + # setuptoolsBuildPhase needs dependencies to be passed through nativeBuildInputs + nativeBuildInputs = [ libxml2.dev libxslt.dev cython ]; + buildInputs = [ libxml2 libxslt zlib ]; - hardeningDisable = stdenv.lib.optional stdenv.isDarwin "format"; + # tests are meant to be ran "in-place" in the same directory as src + doCheck = false; - meta = { + pythonImportsCheck = [ "lxml" "lxml.etree" ]; + + meta = with stdenv.lib; { description = "Pythonic binding for the libxml2 and libxslt libraries"; homepage = https://lxml.de; - license = stdenv.lib.licenses.bsd3; - maintainers = with stdenv.lib.maintainers; [ sjourdois ]; + license = licenses.bsd3; + maintainers = with maintainers; [ jonringer sjourdois ]; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 34bfb5019aa..adebb9ac392 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3707,7 +3707,7 @@ in { logilab-constraint = callPackage ../development/python-modules/logilab/constraint.nix {}; - lxml = callPackage ../development/python-modules/lxml {inherit (pkgs) libxml2 libxslt;}; + lxml = callPackage ../development/python-modules/lxml {inherit (pkgs) libxml2 libxslt zlib;}; lxc = callPackage ../development/python-modules/lxc { };