remove some repetition in the package definition

This commit is contained in:
Jean-Paul Calderone 2023-03-13 19:03:26 -04:00
parent 6e6fc2d307
commit 99559638b9
2 changed files with 13 additions and 63 deletions

View File

@ -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;
}

View File

@ -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