!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

298 Members
https://github.com/nix-community/poetry2nix | Poetry2nix is unmaintained https://github.com/nix-community/poetry2nix/issues/186553 Servers

Load older messages


SenderMessageTime
12 Sep 2024
@truh:matrix.orgtruh Nah, the git clone in setup.py thing just won't work with nix 08:41:45
@truh:matrix.orgtruhLooks like setup.py won't try to call git clone if you give it the folder some other way.08:45:06
@truh:matrix.orgtruhScreenshot 2024-09-12 at 10.43.33.png
Download Screenshot 2024-09-12 at 10.43.33.png
08:45:15
@wecmyrc:matrix.orgwecmyrc
In reply to @truh:matrix.org
wecmyrc my guess would be that you need to add git to the buildInputs of RHVoice https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md
Thank you for the response. I think that during the build process, nix cannot use git, so I will use data obtained using fetchFromGitHub.
08:56:52
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)
In reply to @wecmyrc:matrix.org
Thank you for the response. I think that during the build process, nix cannot use git, so I will use data obtained using fetchFromGitHub.
(nix derivations can not access the network at all. Except for 'fixed output derivations', were you know exactly what they're going to produce.)
10:11:45
13 Sep 2024
@truh:matrix.orgtruhHence my second suggestion to provide the rhvoice source some other way.08:48:25
@wecmyrc:matrix.orgwecmyrc

I tried to provide RHVoice like this:

rhvoiceRepo = pkgs.fetchFromGitHub {
  owner = "RHVoice";
  repo = "RHVoice";
  rev = "8aac098edd6dac823abcfd64f2d141aea0d20bfc";
  sha256 = "sha256-1+kad+tWcmxYDlH7EAcvTGUNAY9dgnk4Kw39XqRjMtE=";
  fetchSubmodules = true;
  deepClone = true;
  leaveDotGit = true;
};

and in rhvoice-wrapped-data configurePhase pass it as link:

configurePhase = ''
  mkdir ./build
  ls -la
  ln -s ${rhvoiceRepo} ./build/RHVoice
'';

But in the end, it didn't work because I assume that setup.py, after installation, tried to delete the RHVoice source, which it didn't have permission to do. So I copied the rhvoice-wrapper-data repository, added RHVoice as a submodule, removed the git requests in setup.py, and now everything works. It's not the most elegant solution, but it's the best I've come up with for now. Thanks everyone for your help.

Here is the working repository: https://github.com/wecmyrc/rhvoice-wrapper-data-patch

Here is an example of usage:

rhvoice-wrapper-data = super.rhvoice-wrapper-data.overridePythonAttrs (old: rec {
  src = pkgs.fetchFromGitHub {
    owner = "wecmyrc";
    repo = "rhvoice-wrapper-data-patch";
    rev = "752534d8a4a99fe69540df201ce2db244c5bf77a";
    sha256 = "sha256-wpci92SxMMEI05gxcqla0sN4aS8JCa0y43WCQwmD2fw=";
    fetchSubmodules = true;
    deepClone = true;
  };
  buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools-scm ];
});
09:08:51
@wecmyrc:matrix.orgwecmyrc *

I tried to provide RHVoice like this:

rhvoiceRepo = pkgs.fetchFromGitHub {
  owner = "RHVoice";
  repo = "RHVoice";
  rev = "8aac098edd6dac823abcfd64f2d141aea0d20bfc";
  sha256 = "sha256-1+kad+tWcmxYDlH7EAcvTGUNAY9dgnk4Kw39XqRjMtE=";
  fetchSubmodules = true;
  deepClone = true;
  leaveDotGit = true;
};

and in rhvoice-wrapped-data configurePhase pass it as link:

configurePhase = ''
  mkdir ./build
  ln -s ${rhvoiceRepo} ./build/RHVoice
'';

But in the end, it didn't work because I assume that setup.py, after installation, tried to delete the RHVoice source, which it didn't have permission to do. So I copied the rhvoice-wrapper-data repository, added RHVoice as a submodule, removed the git requests in setup.py, and now everything works. It's not the most elegant solution, but it's the best I've come up with for now. Thanks everyone for your help.

Here is the working repository: https://github.com/wecmyrc/rhvoice-wrapper-data-patch

Here is an example of usage:

rhvoice-wrapper-data = super.rhvoice-wrapper-data.overridePythonAttrs (old: rec {
  src = pkgs.fetchFromGitHub {
    owner = "wecmyrc";
    repo = "rhvoice-wrapper-data-patch";
    rev = "752534d8a4a99fe69540df201ce2db244c5bf77a";
    sha256 = "sha256-wpci92SxMMEI05gxcqla0sN4aS8JCa0y43WCQwmD2fw=";
    fetchSubmodules = true;
    deepClone = true;
  };
  buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools-scm ];
});
09:20:16
16 Sep 2024
@silentlurker:matrix.orgsilentlurker joined the room.20:02:27
17 Sep 2024
@penguincoder:matrix.wolfie.pw@penguincoder:matrix.wolfie.pw left the room.14:40:13
18 Sep 2024
@artur:glasgow.socialmoved to @amadaluzia:tchncs.de changed their profile picture.23:00:42
21 Sep 2024
@luna-null:matrix.org@luna-null:matrix.org joined the room.05:45:21
@j0xxx:nixbitcoin.orgwkhi, does anyone know if there is a way to override MAX_JOBS when building a python package? Getting OOM errors09:13:04
@k900:0upti.meK900 --option cores 4 09:32:12
@k900:0upti.meK900Or whatever number you want09:32:15
@j0xxx:nixbitcoin.orgwkhmm i was hoping to be able to override just that package so the rest of the system is unaffected plus it doesnt require keeping track of extra build parameters10:50:26
25 Sep 2024
@luna-null:matrix.org@luna-null:matrix.org changed their display name from luna-null to Autumn.06:39:14
26 Sep 2024
@ersei:ersei.net@ersei:ersei.net joined the room.02:05:20
@ersei:ersei.net@ersei:ersei.netHey all, I'm having trouble with poetry2nix. My pyproject.toml has psycopg-c, and when I go to build the package, I get a "ModuleNotFoundError: No module named 'setuptools'"02:07:42
@ersei:ersei.net@ersei:ersei.netany guidance?02:07:48
@ersei:ersei.net@ersei:ersei.netafaik psycopg-c should have the override already02:19:35
@ersei:ersei.net@ersei:ersei.netI added an override I guess02:31:24
@jfahne:matrix.orgjfahne joined the room.02:45:44
@vengmark2:matrix.org@vengmark2:matrix.org
In reply to @ersei:ersei.net
I added an override I guess
Did that work? If so, would you be OK to create a PR?
02:48:05
@ersei:ersei.net@ersei:ersei.net
In reply to @vengmark2:matrix.org
Did that work? If so, would you be OK to create a PR?
yeah, I was just confused since I thought psycopg-c already has one
03:03:01
27 Sep 2024
@ericadelagnier:multi.coopErica joined the room.15:36:54
@ericadelagnier:multi.coopErica Hello and thanks for your work, I'm trying to package my poetry project and I have a few issues. I created a basic app to experiment, if you want to reproduce my bugs. 15:53:52
@ericadelagnier:multi.coopEricaWhen following the tutorial without flakes I'm facing this error message : 15:53:57
@ericadelagnier:multi.coopErica
nix-build default.nix
error:
       … while evaluating the attribute 'drvPath'

         at /nix/store/pp307nbzkgsd6393zl2i9j4j86z5nz9b-nixpkgs-src/lib/customisation.nix:228:7:

          227|     in commonAttrs // {
          228|       drvPath = assert condition; drv.drvPath;
             |       ^
          229|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: function 'anonymous lambda' called with unexpected argument 'flit-core'

       at /nix/store/pp307nbzkgsd6393zl2i9j4j86z5nz9b-nixpkgs-src/pkgs/development/python-modules/wheel/default.nix:1:1:

            1| { lib
             | ^
            2| , buildPythonPackage

I'm a bit confused by niv since I don't usually use it, I tried to run the command both inside the nix-shell including niv and outside and I'm still getting the same error

15:54:11
@ericadelagnier:multi.coopEricaWhen using flakes, I was able to run my flake (yeah !) but I now have a question regarding the dependency environment can't seems to find the right syntax to build it. 15:54:20

Show newer messages


Back to Room ListRoom Version: 6