From 16fd427b153551f139a39c5e9d371a2611da3a39 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Thu, 27 Jan 2022 16:27:10 -0500 Subject: [PATCH] Get undetected txi2p-tahoe test dependency into the test environment --- default.nix | 6 +++++- tests.nix | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 044f59e7b..03ab89a4e 100644 --- a/default.nix +++ b/default.nix @@ -28,7 +28,7 @@ in # and those cases are handled below. The version can only be extracted if # `setup.py update_version` has been run (this is not at all ideal but it # seems difficult to fix) - so for now just be sure to run that first. -mach-nix.buildPythonPackage { +mach-nix.buildPythonPackage rec { # Define the location of the Tahoe-LAFS source to be packaged. Clean up all # as many of the non-source files (eg the `.git` directory, `~` backup # files, nix's own `result` symlink, etc) as possible to avoid needing to @@ -86,4 +86,8 @@ mach-nix.buildPythonPackage { # in its source distribution. click-default-group.patches = []; }; + + passthru.meta.mach-nix = { + inherit providers _; + }; } diff --git a/tests.nix b/tests.nix index 364407e87..5b6eae497 100644 --- a/tests.nix +++ b/tests.nix @@ -16,9 +16,15 @@ let tahoe-lafs = import ./. (args // { extras = [ "test" ]; }); # Put it into a Python environment. - python-env = pkgs.${pythonVersion}.withPackages (ps: [ - tahoe-lafs - ]); + python-env = mach-nix.mkPython { + inherit (tahoe-lafs.meta.mach-nix) providers _; + packagesExtra = [ tahoe-lafs ]; + requirements = '' + # txi2p-tahoe is another dependency with an environment marker that + # mach-nix doesn't automatically pick up. + txi2p-tahoe + ''; + }; in # Make a derivation that runs the unit test suite. pkgs.runCommand "tahoe-lafs-tests" { } ''