1lib: self: super:
2
3with self;
4
5let
6 # Removing recurseForDerivation prevents derivations of aliased attribute
7 # set to appear while listing all the packages available.
8 removeRecurseForDerivations = alias: with lib;
9 if alias.recurseForDerivations or false then
10 removeAttrs alias ["recurseForDerivations"]
11 else alias;
12
13 # Disabling distribution prevents top-level aliases for non-recursed package
14 # sets from building on Hydra.
15 removeDistribute = alias: with lib;
16 if isDerivation alias then
17 dontDistribute alias
18 else alias;
19
20 # Make sure that we are not shadowing something from
21 # python-packages.nix.
22 checkInPkgs = n: alias: if builtins.hasAttr n super
23 then throw "Alias ${n} is still in python-packages.nix"
24 else alias;
25
26 mapAliases = aliases:
27 lib.mapAttrs (n: alias: removeDistribute
28 (removeRecurseForDerivations
29 (checkInPkgs n alias)))
30 aliases;
31in
32
33 ### Deprecated aliases - for backward compatibility
34
35mapAliases ({
36 smart_open = smart-open; # added 2021-03-14
37 google_api_python_client = google-api-python-client; # added 2021-03-19
38 googleapis_common_protos = googleapis-common-protos; # added 2021-03-19
39})