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.

(cherry picked from commit b59875ef23dabddceda3673a7559ebbede9ab6aa)
This commit is contained in:
Matthieu Coudron 2021-06-09 23:56:48 +02:00 committed by Frederik Rietdijk
parent b3872ff69c
commit 889a9b7c11
1 changed files with 2 additions and 0 deletions

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.