release-python.nix: automatically detect buildPythonPackage

+15 -7
+2
pkgs/development/python-modules/generic/default.nix
··· 127 127 } // meta // { 128 128 # add extra maintainer(s) to every package 129 129 maintainers = (meta.maintainers or []) ++ [ chaoflow iElectric ]; 130 + # a marker for release utilies to discover python packages 131 + isBuildPythonPackage = python.meta.platforms; 130 132 }; 131 133 })
+13 -7
pkgs/top-level/release-python.nix
··· 9 9 supportedSystems ? [ "x86_64-linux" ] 10 10 }: 11 11 12 + with import ../../lib; 12 13 with import ./release-lib.nix {inherit supportedSystems; }; 13 14 14 - (mapTestOn { 15 - pypyPackages = packagePlatforms pkgs.pypyPackages; 16 - pythonPackages = packagePlatforms pkgs.pythonPackages; 17 - python33Packages = packagePlatforms pkgs.python33Packages; 18 - python34Packages = packagePlatforms pkgs.python34Packages; 19 - python35Packages = packagePlatforms pkgs.python35Packages; 20 - }) 15 + let 16 + packagePython = mapAttrs (name: value: 17 + let res = builtins.tryEval ( 18 + if isDerivation value then 19 + value.meta.isBuildPythonPackage or [] 20 + else if value.recurseForDerivations or false || value.recurseForRelease or false then 21 + packagePython value 22 + else 23 + []); 24 + in if res.success then res.value else [] 25 + ); 26 + in (mapTestOn (packagePython pkgs))