!VjfUzaKsXokUdnQcvP:nixos.org

Nixpkgs Python

360 Members
Python packaging for and with Nixpkgs. | We are not involved in #dream2nix:nixos.org, mach-nix (unmaintained), #poetry2nix:nixos.org and other out-of-tree tools89 Servers

Load older messages


SenderMessageTime
1 Mar 2024
@hexa:lossy.networkhexa (PEP725 when)using buildPythonPackage and buildPythonApplication, yes16:34:15
@hexa:lossy.networkhexa (PEP725 when)using out-of-tree tools, no16:34:20
@daddychan:matrix.orgdaddychanPerfect! I'm using buildPythonPackage and am just doing it for personal use but would love to contribute if I get it working16:34:46
@daddychan:matrix.orgdaddychan

Working on kaleido and have this so far

        { buildPythonPackage, fetchPypi }:
          buildPythonPackage rec {
            pname = "kaleido";
            version = "0.2.1";
            format = "wheel";

            src = fetchPypi {
              inherit pname version format;
              platform = "manylinux1_x86_64";
              sha256 = "sha256-qiHPG/HHj4+lCp99ReEAPDh709b+CnZ8+780S5W9w6g=";
            };

            fixupStage = ''
              patchShebangs $out/executable/kaleido
            '';
          }

I'm trying to patch the shebang for a specific executable file and can't seem to grab it

16:37:12
@daddychan:matrix.orgdaddychan The file is at /nix/store/path/to/site-packages/kaleido/executable/kaleido 16:38:01
@daddychan:matrix.orgdaddychan *

Working on kaleido and have this so far

        { buildPythonPackage, fetchPypi }:
          buildPythonPackage rec {
            pname = "kaleido";
            version = "0.2.1";
            format = "wheel";

            src = fetchPypi {
              inherit pname version format;
              platform = "manylinux1_x86_64";
              sha256 = "sha256-qiHPG/HHj4+lCp99ReEAPDh709b+CnZ8+780S5W9w6g=";
            };

            postFixup = ''
              patchShebangs $out/executable/kaleido
            '';
          }

I'm trying to patch the shebang for a specific executable file and can't seem to grab it

16:38:27
@k900:0upti.meK900 ⚡️That's wrong16:39:16
@hexa:lossy.networkhexa (PEP725 when)the python builder will wrap the buiild, so the shebang will be correct at that point16:39:20
@k900:0upti.meK900 ⚡️It should be at $out/bin/kaleido16:39:24
@hexa:lossy.networkhexa (PEP725 when)you'll likely want to patchShebangs in some patch phase if needed16:39:32
@hexa:lossy.networkhexa (PEP725 when)oh and that16:39:38
@daddychan:matrix.orgdaddychanWrong as in I should be using $out/executable/kaleido or the kaleido package is doing something wrong and shouldn't be placing in a directory called executable?16:40:24
@k900:0upti.meK900 ⚡️Both16:40:41
@daddychan:matrix.orgdaddychanRats16:40:53
@k900:0upti.meK900 ⚡️ If you want to patch that specific executable, you need to use patchShebangs on $out/lib/python3.11/site-packages/kaleido/executable/kaleido 16:41:08
@k900:0upti.meK900 ⚡️(or whatever)16:41:11
@daddychan:matrix.orgdaddychanAhhh cool16:41:23
@k900:0upti.meK900 ⚡️ As in, $out is just the first level of directory in /nix/store 16:41:25
@k900:0upti.meK900 ⚡️But that executable being there is also wrong16:41:32
@daddychan:matrix.orgdaddychanYeah the reason I reached for that directory is because after getting it packaged, I was able to import but then got a python error when trying to use it because it was reaching into that folder specifically to use the executable16:42:10
@k900:0upti.meK900 ⚡️If it's just copying a prebuilt executable to that directory, you have bigger problems anyway16:44:41
@k900:0upti.meK900 ⚡️Like the fact that there's a prebuilt executable16:44:48
@daddychan:matrix.orgdaddychanWell I was so focused on just getting the shell script to run that I failed to realize it is indeed calling a binary in the script so you're right. Seems like I'd need to package kaleido itself and then work on the python package.16:47:47
@r_i_s:matrix.orgris_ https://github.com/NixOS/nixpkgs/pull/292195#issuecomment-1972221234 - how do you think would be the best way to handle adding an alternate version of a python3Package to the stable branch? it's something we occasionally do if we don't have a backported fix for a security issue and we think the straight bump is too significant. but i'm not sure if we've done it for a python package before and i'd be keen to nudge people who wanted to switch to gradio_4 to setup a proper overlay 22:18:55
2 Mar 2024
@sandro:supersandro.deSandro 🐧Add it under a different attr. We should catch conflicts by now. 16:35:54
@sandro:supersandro.deSandro 🐧but then no one is using it by default 🤷16:36:01
@r_i_s:matrix.orgris_ incidentally, it would be nice if there were a way of overriding pythonPackages just once and have it apply to python311Packages, python312Packages et al? but i guess that would be tricky what with referential transparency etc 17:10:46
@sandro:supersandro.deSandro 🐧there is, pythonPackagesExtensions17:39:10
@mattleon:matrix.orgmattleon joined the room.19:50:34
4 Mar 2024
@44l-ccq:matrix.uni-hannover.deÉtienne Wodey joined the room.13:03:30

There are no newer messages yet.


Back to Room ListRoom Version: 6