From baf91ea7d9ffab6d1f95395b7c2f724a2e349698 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. --- 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.