writers.writePython2: remove

+46 -49
+2
nixos/doc/manual/release-notes/rl-2205.section.md
··· 34 - `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2. 35 Please switch to `claws-mail`, which is Claws Mail's latest release based on GTK+3 and Python 3. 36 37 ## Other Notable Changes {#sec-release-22.05-notable-changes} 38 39 - The option [services.redis.servers](#opt-services.redis.servers) was added
··· 34 - `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2. 35 Please switch to `claws-mail`, which is Claws Mail's latest release based on GTK+3 and Python 3. 36 37 + - The `writers.writePython2` and corrersponding `writers.writePython2Bin` convenience functions to create executable Python 2 scripts in the store were removed in preparation of removal of the Python 2 interpreter. 38 + 39 ## Other Notable Changes {#sec-release-22.05-notable-changes} 40 41 - The option [services.redis.servers](#opt-services.redis.servers) was added
+35
pkgs/build-support/writers/aliases.nix
···
··· 1 + lib: prev: 2 + 3 + let 4 + # Removing recurseForDerivation prevents derivations of aliased attribute 5 + # set to appear while listing all the packages available. 6 + removeRecurseForDerivations = alias: with lib; 7 + if alias.recurseForDerivations or false then 8 + removeAttrs alias ["recurseForDerivations"] 9 + else alias; 10 + 11 + # Disabling distribution prevents top-level aliases for non-recursed package 12 + # sets from building on Hydra. 13 + removeDistribute = alias: with lib; 14 + if isDerivation alias then 15 + dontDistribute alias 16 + else alias; 17 + 18 + # Make sure that we are not shadowing something from 19 + # writers. 20 + checkInPkgs = n: alias: if builtins.hasAttr n prev 21 + then throw "Alias ${n} is still in writers" 22 + else alias; 23 + 24 + mapAliases = aliases: 25 + lib.mapAttrs (n: alias: removeDistribute 26 + (removeRecurseForDerivations 27 + (checkInPkgs n alias))) 28 + aliases; 29 + 30 + in 31 + mapAliases ({ 32 + /* Cleanup before 22.05, Added 2021-12-11 */ 33 + writePython2 = "Python 2 is EOL and the use of writers.writePython2 is deprecated."; 34 + writePython2Bin = "Python 2 is EOL and the use of writers.writePython2Bin is deprecated."; 35 + })
+9 -22
pkgs/build-support/writers/default.nix
··· 1 - { pkgs, buildPackages, lib, stdenv, libiconv, gawk, gnused, gixy }: 2 3 - with lib; 4 - rec { 5 # Base implementation for non-compiled executables. 6 # Takes an interpreter, for example `${pkgs.bash}/bin/bash` 7 # ··· 245 ''); 246 } name; 247 248 - # writePython2 takes a name an attributeset with libraries and some python2 sourcecode and 249 - # returns an executable 250 - # 251 - # Example: 252 - # writePython2 "test_python2" { libraries = [ pkgs.python2Packages.enum ]; } '' 253 - # from enum import Enum 254 - # 255 - # class Test(Enum): 256 - # a = "success" 257 - # 258 - # print Test.a 259 - # '' 260 - writePython2 = makePythonWriter pkgs.python2 pkgs.python2Packages; 261 - 262 - # writePython2Bin takes the same arguments as writePython2 but outputs a directory (like writeScriptBin) 263 - writePython2Bin = name: 264 - writePython2 "/bin/${name}"; 265 - 266 # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and 267 # returns an executable 268 # ··· 280 # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) 281 writePython3Bin = name: 282 writePython3 "/bin/${name}"; 283 - }
··· 1 + { pkgs, config, buildPackages, lib, stdenv, libiconv, gawk, gnused, gixy }: 2 3 + let 4 + aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else prev: {}; 5 + 6 + writers = with lib; rec { 7 # Base implementation for non-compiled executables. 8 # Takes an interpreter, for example `${pkgs.bash}/bin/bash` 9 # ··· 247 ''); 248 } name; 249 250 # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and 251 # returns an executable 252 # ··· 264 # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) 265 writePython3Bin = name: 266 writePython3 "/bin/${name}"; 267 + 268 + }; 269 + in 270 + writers // (aliases writers)
-27
pkgs/build-support/writers/test.nix
··· 3 , lib 4 , nodePackages 5 , perlPackages 6 - , python2Packages 7 , python3Packages 8 , runCommand 9 , writers ··· 54 print "success\n" if true; 55 ''; 56 57 - python2 = writePython2Bin "test-writers-python2-bin" { libraries = [ python2Packages.enum ]; } '' 58 - from enum import Enum 59 - 60 - 61 - class Test(Enum): 62 - a = "success" 63 - 64 - 65 - print Test.a 66 - ''; 67 - 68 python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' 69 import yaml 70 ··· 111 print "success\n" if true; 112 ''; 113 114 - python2 = writePython2 "test-writers-python2" { libraries = [ python2Packages.enum ]; } '' 115 - from enum import Enum 116 - 117 - 118 - class Test(Enum): 119 - a = "success" 120 - 121 - 122 - print Test.a 123 - ''; 124 - 125 python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' 126 import yaml 127 ··· 129 - test: success 130 """) 131 print(y[0]['test']) 132 - ''; 133 - 134 - python2NoLibs = writePython2 "test-writers-python2-no-libs" {} '' 135 - print("success") 136 ''; 137 138 python3NoLibs = writePython3 "test-writers-python3-no-libs" {} ''
··· 3 , lib 4 , nodePackages 5 , perlPackages 6 , python3Packages 7 , runCommand 8 , writers ··· 53 print "success\n" if true; 54 ''; 55 56 python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' 57 import yaml 58 ··· 99 print "success\n" if true; 100 ''; 101 102 python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' 103 import yaml 104 ··· 106 - test: success 107 """) 108 print(y[0]['test']) 109 ''; 110 111 python3NoLibs = writePython3 "test-writers-python3-no-libs" {} ''