From 99559638b93b2ac08d6740d26e2bfbe5dee43fc5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 13 Mar 2023 19:03:26 -0400 Subject: [PATCH] remove some repetition in the package definition --- default.nix | 12 ++++++--- nix/tahoe-lafs.nix | 64 ++++------------------------------------------ 2 files changed, 13 insertions(+), 63 deletions(-) diff --git a/default.nix b/default.nix index 87f398ca5..3ecc88ec1 100644 --- a/default.nix +++ b/default.nix @@ -31,7 +31,13 @@ in # cost of re-building the whole thing to add them. }: -with pkgs.${pythonVersion}.pkgs; +with (pkgs.${pythonVersion}.override { + packageOverrides = self: super: { + # Some dependencies aren't packaged in nixpkgs so supply our own packages. + pycddl = self.callPackage ./nix/pycddl.nix { }; + txi2p = self.callPackage ./nix/txi2p.nix { }; + }; +}).pkgs; callPackage ./nix/tahoe-lafs.nix { # Select whichever package extras were requested. inherit extrasNames; @@ -42,7 +48,5 @@ callPackage ./nix/tahoe-lafs.nix { # when files that make no difference to the package have changed. tahoe-lafs-src = pkgs.lib.cleanSource ./.; - # Some dependencies aren't packaged in nixpkgs so supply our own packages. - pycddl = callPackage ./nix/pycddl.nix { }; - txi2p = callPackage ./nix/txi2p.nix { }; + doCheck = false; } diff --git a/nix/tahoe-lafs.nix b/nix/tahoe-lafs.nix index 62fba48b1..380260c70 100644 --- a/nix/tahoe-lafs.nix +++ b/nix/tahoe-lafs.nix @@ -1,65 +1,11 @@ { lib +, pythonPackages , buildPythonPackage , tahoe-lafs-src , extrasNames # control how the test suite is run -, doCheck ? false - -# always dependencies -, attrs -, autobahn -, cbor2 -, click -, collections-extended -, cryptography -, distro -, eliot -, filelock -, foolscap -, future -, klein -, magic-wormhole -, netifaces -, psutil -, pycddl -, pyrsistent -, pyutil -, six -, treq -, twisted -, werkzeug -, zfec -, zope_interface - -# tor extra dependencies -, txtorcon - -# i2p extra dependencies -, txi2p - -# twisted extra dependencies - if there is overlap with our dependencies we -# have to skip them since we can't have a name in the argument set twice. -, appdirs -, bcrypt -, idna -, pyasn1 -, pyopenssl -, service-identity - -# test dependencies -, beautifulsoup4 -, fixtures -, hypothesis -, mock -, paramiko -, prometheus-client -, pytest -, pytest-timeout -, pytest-twisted -, tenacity -, testtools -, towncrier +, doCheck }: let pname = "tahoe-lafs"; @@ -67,12 +13,12 @@ let pickExtraDependencies = deps: extras: builtins.foldl' (accum: extra: accum ++ deps.${extra}) [] extras; - pythonExtraDependencies = { + pythonExtraDependencies = with pythonPackages; { tor = [ txtorcon ]; i2p = [ txi2p ]; }; - pythonPackageDependencies = [ + pythonPackageDependencies = with pythonPackages; [ attrs autobahn cbor2 @@ -102,7 +48,7 @@ let zope_interface ] ++ pickExtraDependencies pythonExtraDependencies extrasNames; - pythonCheckDependencies = [ + pythonCheckDependencies = with pythonPackages; [ beautifulsoup4 fixtures hypothesis