summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/mk-python-derivation.nix
diff options
context:
space:
mode:
authorMatthieu Coudron <mcoudron@hotmail.com>2021-06-09 23:56:48 +0200
committerMatthieu Coudron <teto@users.noreply.github.com>2021-06-12 23:23:35 +0200
commitbaf91ea7d9ffab6d1f95395b7c2f724a2e349698 (patch)
tree6872cb193c7a65ab2bede11ed0d2ce33a97d27c0 /pkgs/development/interpreters/python/mk-python-derivation.nix
parent38a0226d57cfbbedbcf813ef9c29049f525c78aa (diff)
downloadnixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar.gz
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar.bz2
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar.lz
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar.xz
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.tar.zst
nixpkgs-baf91ea7d9ffab6d1f95395b7c2f724a2e349698.zip
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.
Diffstat (limited to 'pkgs/development/interpreters/python/mk-python-derivation.nix')
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix2
1 files changed, 2 insertions, 0 deletions
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.