Changeset 72539dd in trunk


Ignore:
Timestamp:
2023-07-04T18:39:26Z (21 months ago)
Author:
Jean-Paul Calderone <exarkun@…>
Branches:
master
Children:
94e608f1
Parents:
9788e4c1
Message:

refactor the env builders a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified flake.nix

    r9788e4c1 r72539dd  
    7474      unitTestName = pyVersion: "${pyVersion}-unittest";
    7575
     76      # (string -> a) -> (string -> b) -> string -> attrset a b
     77      #
     78      # Make a singleton attribute set from the result of two functions.
     79      singletonOf = f: g: x: { ${f x} = g x; };
     80
    7681      # Create a derivation that includes a Python runtime, Tahoe-LAFS, and
    7782      # all of its dependencies.
    78       makeRuntimeEnv = pyVersion: {
    79         ${packageName pyVersion} = makeRuntimeEnv' pyVersion;
    80       };
    81 
     83      makeRuntimeEnv = singletonOf packageName makeRuntimeEnv';
    8284      makeRuntimeEnv' = pyVersion: (pkgs.${pyVersion}.withPackages (ps: with ps;
    8385        [ tahoe-lafs ] ++
     
    9092      # Create a derivation that includes a Python runtime, Tahoe-LAFS, and
    9193      # all of its dependencies.
    92       makeTestEnv = pyVersion: {
    93         ${packageName pyVersion} = makeTestEnv' pyVersion;
    94       };
    95 
    96       makeTestEnv' = pyVersion: (pkgs.${pyVersion}.withPackages (ps: with ps;
     94      makeTestEnv = pyVersion: (pkgs.${pyVersion}.withPackages (ps: with ps;
    9795        [ tahoe-lafs ] ++
    9896        tahoe-lafs.passthru.extras.i2p ++
     
    149147                  ''
    150148                    export TAHOE_LAFS_HYPOTHESIS_PROFILE=ci
    151                     ${makeTestEnv' pyVersion}/bin/python -m twisted.trial "$@"
     149                    ${makeTestEnv pyVersion}/bin/python -m twisted.trial "$@"
    152150                  '';
    153151            };
Note: See TracChangeset for help on using the changeset viewer.