pythonPackages: set mainProgram to pname by default

Calling `nix run poetry` or another python package usually fails
because of the "pythonX" prefix in name.
Adjust mainProgram to ignore that prefix.
This commit is contained in:
Matthieu Coudron 2021-06-09 23:56:48 +02:00 committed by Matthieu Coudron
parent 38a0226d57
commit baf91ea7d9

View file

@ -176,6 +176,8 @@ let
# default to python's platforms
platforms = python.meta.platforms;
isBuildPythonPackage = python.meta.platforms;
} // lib.optionalAttrs (attrs?pname) {
mainProgram = attrs.pname;
} // meta;
} // lib.optionalAttrs (attrs?checkPhase) {
# If given use the specified checkPhase, otherwise use the setup hook.