!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

315 Members
https://github.com/nix-community/poetry2nix60 Servers

Load older messages


SenderMessageTime
17 Feb 2022
@worldofgeese:one.ems.hostworldofgeese So maybe it's a dockerTools bug? 07:57:47
@k900:0upti.meK900It might be07:57:54
@worldofgeese:one.ems.hostworldofgeese I think my next step will be to build a container image with something like buildah or just writing a plain Dockerfile and test if it works that way. If it does, I'll file the issue as a dockerTools bug and let the packagers decide what it's a bug of 08:00:17
21 Feb 2022
@jairo:recallstack.icuJairo LlopisRedacted or Malformed Event12:47:43
@jairo:recallstack.icuJairo Llopishello people. I'm trying to get a proper devShell. So far I have followed the example from https://github.com/nix-community/poetry2nix#example-shellnix12:48:56
@jairo:recallstack.icuJairo LlopisIt's working, but... poetry is not inside the shell. How to add it?12:49:14
@jairo:recallstack.icuJairo Llopis
> nix develop -c which python
/nix/store/08aymzy89d1r2sviq2rn00ciip25wha4-python3-3.9.10-env/bin/python

> nix develop -c which poetry
/var/home/yajo/.local/bin/poetry
12:50:19
@jairo:recallstack.icuJairo LlopisSee? I expected poetry to be available from the nix store instead... how to do that?12:51:02
@jairo:recallstack.icuJairo Llopis

I tried adding poetry to extraPackages but didn't work:

      devShell = prev.poetry2nix.mkPoetryEnv {
        projectDir = ./.;
        editablePackageSources = {
          monix = ./monix;
        };
        extraPackages = ps: with ps; [
          poetry
        ];
      }.env;

It failed:

error: collision between `/nix/store/2bn57zh92ajirim070nkzqyp7ialwf3g-python3.9-poetry-core-1.0.7/lib/python3.9/site-packages/poetry/__init__.py' and `/nix/store/jv411g1gg5njclqnas9md97y0p55z06c-python3.9-poetry-1.1.12/lib/python3.9/site-packages/poetry/__init__.py'
12:52:11
@milchdealer:matrix.orgteraku joined the room.15:27:49
@milchdealer:matrix.orgteraku

Hello! I'm trying to use poetry2nix for a kubeflow project we have. This means it unfortunately runs with Py3.6 (soon 3.8 I heard). I got to a point where I was able to specify Python 3.6, but now I am getting a version mismatch arrow:
error: arrow-cpp version (7.0) mismatches pyarrow version (2.0)

I'm not entirely sure where it gets arrow-cpp 7.0 from, my pyarrow version specified in the poetry.lock is 2.0.

My default.nix:

{ pkgs ? import <nixpkgs> {} }:
let
python36 = import <darwin20.python36> { system = "x86_64-darwin"; };
myAppEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
editablePackageSources = {
ml-policy-compliance = ./ml_policy_compliance;
};
};
in myAppEnv.env

15:36:05
@milchdealer:matrix.orgteraku *

Hello! I'm trying to use poetry2nix for a kubeflow project we have. This means it unfortunately runs with Py3.6 (soon 3.8 I heard). I got to a point where I was able to specify Python 3.6, but now I am getting a version mismatch arrow:
error: arrow-cpp version (7.0) mismatches pyarrow version (2.0)

I'm not entirely sure where it gets arrow-cpp 7.0 from, my pyarrow version specified in the poetry.lock is 2.0.

My default.nix:

{ pkgs ? import <nixpkgs> {} }:
let
python36 = import <darwin20.python36> { system = "x86_64-darwin"; };
myAppEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
editablePackageSources = {
ml-policy-compliance = ./ml_policy_compliance;
};
};
in myAppEnv.env
15:36:19
@milchdealer:matrix.orgterakuCan somebody point me into the right direction here?15:37:29
@milchdealer:matrix.orgterakudarwin20 refers to an older channel: https://releases.nixos.org/nixpkgs/20.09-darwin/nixpkgs-darwin-20.09pre247167.1c1f5649bb915:40:28
@mou_bugtracker:matrix.orgmou
In reply to @jairo:recallstack.icu
hello people. I'm trying to get a proper devShell. So far I have followed the example from https://github.com/nix-community/poetry2nix#example-shellnix

Hi, Jairo. This is how i define devShell in most cases

        devShell = (pkgs.poetry2nix.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            exyaru = ./.;
          };
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = [ pkgs.poetry ];
        });

18:08:52
@mou_bugtracker:matrix.orgmou But it's better to do concatentation of oldAttrs.buildInputs with new list. But this works for my projects, because there is no buildInputs exists before overriding 18:10:38
@k900:0upti.meK900 changed their display name from K900 to whatever.20:39:53
@k900:0upti.meK900 changed their display name from whatever to K900.20:40:08
22 Feb 2022
@jairo:recallstack.icuJairo Llopis
In reply to @mou_bugtracker:matrix.org

Hi, Jairo. This is how i define devShell in most cases

        devShell = (pkgs.poetry2nix.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            exyaru = ./.;
          };
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = [ pkgs.poetry ];
        });

thanks, it works!
09:41:46
@x10an14:matrix.orgx10an14 joined the room.15:21:37
@x10an14:matrix.orgx10an14 Anyone here got a tip for me how to overcome this build error? https://paste.sr.ht/~x10an14/9ad4459b175e516d04bc3fb17123c3206da6a3c0#nix%20build%20log%20error-L94 It's my first time using poetry2nix, so I may have messed up my flake.nix... 15:56:07
@mou_bugtracker:matrix.orgmou
In reply to @x10an14:matrix.org
Anyone here got a tip for me how to overcome this build error? https://paste.sr.ht/~x10an14/9ad4459b175e516d04bc3fb17123c3206da6a3c0#nix%20build%20log%20error-L94 It's my first time using poetry2nix, so I may have messed up my flake.nix...

Try to define mkPoetryApplication with override like this

    defaultPythonSetup = {
      projectDir = ./.;
      overrides = prev.poetry2nix.defaultPoetryOverrides.extend ( self: super: {
              prospector = super.uengine.overridePythonAttrs (
                old: {
                  buildInputs = (old.buildInputs or [ ]) ++ [ self.poetry ];
                }
              );
            });
          };

Sorry for formatting

16:43:45
@mou_bugtracker:matrix.orgmouIt's my guess based on error log. I assume, prospector package using poetry for building, but poetry2nix have no information about this fact, so there is possibly missing build dependency16:45:59
@mou_bugtracker:matrix.orgmousorry, i messed up.16:46:29
@x10an14:matrix.orgx10an14
In reply to @mou_bugtracker:matrix.org

Try to define mkPoetryApplication with override like this

    defaultPythonSetup = {
      projectDir = ./.;
      overrides = prev.poetry2nix.defaultPoetryOverrides.extend ( self: super: {
              prospector = super.uengine.overridePythonAttrs (
                old: {
                  buildInputs = (old.buildInputs or [ ]) ++ [ self.poetry ];
                }
              );
            });
          };

Sorry for formatting

Thanks! Can't get that to work though, seems like it won't merge properly? As-is, it complains about the prev on your line 3, since defaultPythonSetup is just an attrset to make things DRY, not an overlay/function.
16:46:35
@mou_bugtracker:matrix.orgmou

here how i define such override (whole example)

      overlay = nixpkgs.lib.composeManyExtensions [ poetry2nix.overlay
        (final: prev: {
          # The application
          myapp = prev.poetry2nix.mkPoetryApplication {
            projectDir = ./.;
            python = prev.python38;
            overrides = prev.poetry2nix.defaultPoetryOverrides.extend ( self: super: {
              brokenPackage = super.brokenPackage.overridePythonAttrs (
                old: {
                  buildInputs = (old.buildInputs or [ ]) ++ [ self.poetry ];
                }
              );
            });
          };
        })
      ];

This is overlay for nixpkgs as it appears in poetry2nix README example

16:48:51
@mou_bugtracker:matrix.orgmouThis is where prev comes from. It refers to pre-override nixpkgs16:49:28
@mou_bugtracker:matrix.orgmou * This is where prev comes from. It refers to pre-overlay nixpkgs16:49:38
@x10an14:matrix.orgx10an14Ahh, gotcha. Thanks! =D16:49:45
@mou_bugtracker:matrix.orgmoui should be more accurate next time. hope my guess is lucky )16:50:52

Show newer messages


Back to Room ListRoom Version: 6