From 889a9b7c11e210de9fa8c88a5fda686d2824c19d Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Wed, 9 Jun 2021 23:56:48 +0200 Subject: [PATCH] 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) --- pkgs/development/interpreters/python/mk-python-derivation.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 4917b167046..963073df620 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -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.