!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

326 Members
https://github.com/nix-community/poetry2nix62 Servers

Load older messages


SenderMessageTime
1 Dec 2023
@k900:0upti.meK900No08:50:54
@k900:0upti.meK900 You can just fetchTarball poetry2nix 08:51:05
@k900:0upti.meK900Or use something like niv that does input tracking without flakes08:51:14
@ilpianista:kde.org@ilpianista:kde.orgah, I see. That's great, thank you!08:52:03
2 Dec 2023
@mao_tse-tung:matrix.orgmao_tse-tung joined the room.04:20:46
@vengmark2:matrix.orgl0b0 This job runs fine locally. What could be going on? 22:00:36
@vengmark2:matrix.orgl0b0 * This job runs fine locally. What could be going on? Is poetry2nix incompatible with the nixos/nix:2.19.2 container? 22:13:26
@vengmark2:matrix.orgl0b0 * This job runs fine locally. What could be going on? Is poetry2nix incompatible with the nixos/nix:2.19.2 container (I'm using Nix 2.18.1 locally)? 22:13:53
3 Dec 2023
@rxzfn2:matrix.orgzf zhang joined the room.03:24:48
@rxzfn2:matrix.orgzf zhangHi, glad to find this great nix tool and find you all here. I have a quick question. I am following this blog https://www.tweag.io/blog/2020-08-12-poetry2nix/ and 03:27:49
@rxzfn2:matrix.orgzf zhang *

Hi, glad to find this great nix tool and find you all here. I have a quick question. I am following this blog https://www.tweag.io/blog/2020-08-12-poetry2nix/ and I enconter this error:

 error: poetry2nix is now maintained out-of-tree. Please use https://github.com/nix-community/poetry2nix/

What does this mean and how to avoid that? Thx!

03:28:52
@rxzfn2:matrix.orgzf zhang

This is my default.nix:

03:29:13
@rxzfn2:matrix.orgzf zhang *

This is my default.nix updated and it still doesn't work:

{ pkgs ? import <nixpkgs> {} }:
let
  poetry2nix = pkgs.poetry2nix.override {
    poetry2nix = pkgs.nix-community.poetry2nix;
  };
in
poetry2nix.mkPoetryApplication {
  projectDir = ./.;
}
03:30:07
@k900:0upti.meK900That's definitely not going to work07:24:38
@k900:0upti.meK900Use the examples on the repo07:24:41
@k900:0upti.meK900Or the example flake07:24:46
@rxzfn2:matrix.orgzf zhang

Thanks! with this config in the readme, I have got the same error.

{ poetry2nix, python3, runCommand }:
let
  env = poetry2nix.mkPoetryEnv {
    python = python3;
    pyproject = ./pyproject.toml;
    poetrylock = ./poetry.lock;
  };
in
runCommand "env-test"
{ } ''
  ${env}/bin/python -c 'import alembic'
  touch $out
''
09:33:32
@rxzfn2:matrix.orgzf zhang Using flake and nix build, it works as expected. 09:33:53
@rxzfn2:matrix.orgzf zhang *

Thanks! with this config in the readme, I have got the same error.

let
  pkgs = import <nixpkgs> {
    overlays = [
      # self & super refers to nixpkgs
      (self: super: {

        # p2self & p2super refers to poetry2nix
        poetry2nix = super.poetry2nix.overrideScope' (p2nixself: p2nixsuper: {

          # pyself & pysuper refers to python packages
          defaultPoetryOverrides = p2nixsuper.defaultPoetryOverrides.extend (pyself: pysuper: {

            my-custom-pkg = super.my-custom-pkg.overridePythonAttrs (oldAttrs: { });

          });

        });
      })

    ];
  };

in pkgs.poetry2nix.mkPoetryApplication {
  projectDir = ./.;
}

09:37:09
4 Dec 2023
@vengmark2:matrix.orgl0b0 Latest Nix (nixos/nix:2.19.2 container), nixpkgs@nixos-unstable (e92039b55bcd58469325ded85d4f58dd5a4eaf58), and poetry2nix@master (7eaec209686dd2a798fa0a86dc2118f4175abf34) don't seem to work together. Are these known to be broken together right now? 07:13:19
@milibopp:matrix.org@milibopp:matrix.org joined the room.12:45:48
5 Dec 2023
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.00:37:53
@virtu:matrix.imvirtu

Hi. I'm getting the following error when trying to build my application via flake:

error: hash mismatch in fixed-output derivation '/nix/store/fygngq683zgps12zy1063gbq8vsjzvzm-cryptography-41.0.7-vendor.tar.gz.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

I read about this issue, but I'm using a flake and made sure the revision for poetry2nix in flake.lock matches the HEAD commit in the master repo. Any ideas what could be wrong?

14:01:13
6 Dec 2023
@virtu:matrix.imvirtu
In reply to @virtu:matrix.im

Hi. I'm getting the following error when trying to build my application via flake:

error: hash mismatch in fixed-output derivation '/nix/store/fygngq683zgps12zy1063gbq8vsjzvzm-cryptography-41.0.7-vendor.tar.gz.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

I read about this issue, but I'm using a flake and made sure the revision for poetry2nix in flake.lock matches the HEAD commit in the master repo. Any ideas what could be wrong?

nevermind. I just saw the commit from yesterday that fixed it. working now.
07:16:43
@quleuber:matrix.org@quleuber:matrix.org joined the room.17:59:51
7 Dec 2023
@cameronraysmith:matrix.org@cameronraysmith:matrix.org joined the room.13:10:21
@quleuber:matrix.org@quleuber:matrix.org

I'd like help to understand editablePackageSources.

I've defined on my flake.nix:

        cexpl-py = (p2n.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            cexpl = ./.;
          };
          overrides = p2n-overrides;
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = dependencies;
        });

and I'm able to import my package:

❯ python3
Python 3.11.6 (main, Oct  2 2023, 13:45:54) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cexpl
>>> cexpl
<module 'cexpl' from '/nix/store/vj18qa9acmghnipqx98x94fqbhg1vcdq-source/cexpl/__init__.py'>
>>>

But it shows up inside the nix store, which is read-only. So, how could it be "editable"?

pip show outputs:

❯ pip show cexpl
Name: cexpl
Version: 0.1.0
Summary:
Home-page:
Author:
Author-email:
License:
Location: /nix/store/2sgs2pfsggbnrpg6hc3lm4b84al8fz32-python3-3.11.6-env/lib/python3.11/site-packages
Requires:
Required-by:

without the Editable project location: ... line.

21:38:52
@quleuber:matrix.org@quleuber:matrix.orgI'd expect for it to point to the local package source folder. But I also don't think it's possible to link something like that inside de Nix store.21:39:53
@adis:blad.isadisbladisAre you using flakes?21:40:59
@k900:0upti.meK900Flakes can't do editable installs 21:41:03

Show newer messages


Back to Room ListRoom Version: 6