!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
21 Aug 2024
@adis:blad.isadisbladis
In reply to @truh:matrix.org
Would this create ovrrides for all depedencies in the poetry.lock? What do you think about a way to tell poetry2nix to not create overrides for particular packages, when I know python3Packages.particular-package would work for my project, requires less build time on my end, and is well maintained. Or does that lead problems
I've been toying with ideas like that for a while :)
10:21:57
@adis:blad.isadisbladis

Excerpt:

# Create a Python overlay from pdm.lock filtered by what already exists in nixpkgs.
# This means that our overlay strictly extending nixpkgs for maximal binary cache hits.
let
  inherit (lib) flip elem attrNames filterAttrs;

  project = pyproject-nix.lib.project.loadPDMPyproject {
    projectRoot = ./.;
  };

  overlay' =
    lib.composeManyExtensions [
      (pdm2nix.lib.lock.mkOverlay {
        inherit project;
        preferWheels = true;
      })
    ];

in pyfinal: pyprev: let
  attrExists = flip elem (attrNames pyprev);
  applied = overlay' pyfinal pyprev;
in
  filterAttrs (n: _: ! attrExists n) applied // {
    # Nixpkgs has an ancient & broken version
    inherit (applied) ezdxf;
  }
10:25:15
22 Aug 2024
@asmundesen:matrix.orgArtur Manuel joined the room.12:58:51
@asmundesen:matrix.orgArtur Manuel changed their profile picture.14:53:11
23 Aug 2024
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)My 7000+ override PR finally passes the CI...13:41:02
27 Aug 2024
@asmundesen:matrix.orgArtur Manuelhey there! i am trying to work on a flake template repository for whenever i need to setup a project but something i have been stuck on is trying to get past an assertionerror that happens only in the installPhase05:54:38
@asmundesen:matrix.orgArtur ManuelSomething i noted is that it works completely fine in base poetry and that this is probably an issue in how I declared the package.05:55:30
@asmundesen:matrix.orgArtur ManuelAll relevant files will be shared in a few hours or so, I am not on my PC right now.05:56:05
@asmundesen:matrix.orgArtur Manuel* Hey there! I am trying to work on a flake template repository for whenever I need to setup a project but something I have been stuck on is trying to get past an assertionerror that happens only in the installPhase.05:59:24
@asmundesen:matrix.orgArtur Manuel* Something I noted is that it works completely fine in base poetry and that this is probably an issue in how I declared the package.05:59:44
28 Aug 2024
@asmundesen:matrix.orgArtur ManuelDownload pyproject.toml15:58:56
@asmundesen:matrix.orgArtur ManuelDownload package.nix15:58:56
@asmundesen:matrix.orgArtur ManuelDownload flake.nix15:58:57
@asmundesen:matrix.orgArtur Manuelhttps://pb.atl.tools/?aeff4a0ddca6e459#3sMAitzNr9ssws16XRKDsmBzRhnDo6fConJrXUbx8EAH17:07:14
@asmundesen:matrix.orgArtur Manuelcomplete error log17:07:18
29 Aug 2024
@artur:glasgow.socialmoved to @amadaluzia:tchncs.de joined the room.05:44:39
30 Aug 2024
@artur:glasgow.socialmoved to @amadaluzia:tchncs.de changed their display name from Artur Manuel (old email was lost, migrating) to (lambda (u) (format nil "~A lost their email!" u)) "Artur Manuel".03:53:34
@tcarls:matrix.orgCharles Duffy ...well, this is a fun one: changing python = pkgs.python312; to python = pkgs.enableDebugging pkgs.python312; results in a pythonEnv without any libraries installed. 18:15:43
2 Sep 2024
@silvio:booq.org@silvio:booq.org Hey, I'm trying to build ansible with poetry2nix, but it fails because pynacl wants sphinxcontrib.applehelp but doesn't find it. 16:32:38
@silvio:booq.org@silvio:booq.org
In reply to @nazarewk:matrix.org
actually seems like it's env -> pynacl -> sphinx-hook... gotta dig more into it
Apparrently I'm not the first one having problems with ansible -> pynacl -> sphinx, but I have no clue how to fix it right now.
16:32:45
@silvio:booq.org@silvio:booq.orgI was able to add some overrides for other packages, but this one I can't figure out.16:33:01
@nazarewk:matrix.orgkdnI can try to find my solution if you need it16:33:22
@silvio:booq.org@silvio:booq.orgThat'd be greatly appreciated! 16:33:41
@nazarewk:matrix.orgkdn * I can try to find my solution if you need it, I think I figured out how to completely skip sphinx and some other packages from building 16:33:44
@nazarewk:matrix.orgkdn
In reply to @silvio:booq.org
Apparrently I'm not the first one having problems with ansible -> pynacl -> sphinx, but I have no clue how to fix it right now.

this seems to be it:

  overrides = poetry2nix.overrides.withDefaults (final: prev: let
    rm.lists = lists: old: builtins.mapAttrs (name: value: lib.subtractLists value old."${name}") lists;
    modified = pkg: fns: pkg.overridePythonAttrs (oldAttrs: lib.pipe oldAttrs (builtins.map (fn: entry: entry // (fn entry)) fns));
  in
    builtins.mapAttrs (name: modified prev."${name}") {
      pynacl = [
        (rm.lists {nativeBuildInputs = with final; [sphinxHook];})
        (rm.lists {outputs = ["doc"];})
      ];
      pyjwt = [
        (rm.lists {nativeBuildInputs = with final; [sphinxHook sphinx-rtd-theme];})
        (rm.lists {outputs = ["doc"];})
      ];
    });
16:34:59
@nazarewk:matrix.orgkdn
In reply to @silvio:booq.org
Apparrently I'm not the first one having problems with ansible -> pynacl -> sphinx, but I have no clue how to fix it right now.
*

this seems to be it:

  overrides = poetry2nix.overrides.withDefaults (final: prev: let
    rm.lists = lists: old: builtins.mapAttrs (name: value: lib.subtractLists value old."${name}") lists;
    modified = pkg: fns: pkg.overridePythonAttrs (oldAttrs: lib.pipe oldAttrs (builtins.map (fn: entry: entry // (fn entry)) fns));
  in
    builtins.mapAttrs (name: modified prev."${name}") {
      pynacl = [
        (rm.lists {nativeBuildInputs = with final; [sphinxHook];})
        (rm.lists {outputs = ["doc"];})
      ];
      pyjwt = [
        (rm.lists {nativeBuildInputs = with final; [sphinxHook sphinx-rtd-theme];})
        (rm.lists {outputs = ["doc"];})
      ];
    });

basically I'm dropping doc output and a single nativeBuildInputs entry from both pyjwt and pynacl packages

16:38:37
@silvio:booq.org@silvio:booq.orgOmg it worked! Thank you so much 🙏16:39:38
3 Sep 2024
@vengmark2:matrix.org@vengmark2:matrix.org Is there some way to set python when importing poetry2nix, rather than when running mkPoetryPackages and the like? 01:35:23
@adis:blad.isadisbladisWhy is that important? It shouldn't matter.01:36:17
@vengmark2:matrix.org@vengmark2:matrix.org
{pkgs}:
let
  poetry2nix = import (
    builtins.fetchTarball {
      name = "poetry2nix-2024.8.2346599";
      url = "https://github.com/nix-community/poetry2nix/archive/7619e43c2b48c29e24b88a415256f09df96ec276.tar.gz";
      sha256 = "10nf9213h7vkzrqhrgk88r5sd2rq19cvdpnn59f65ifak790sgc0";
    }
  ) {
    inherit pkgs;
  };
in
  poetry2nix.overrideScope (finalPoetry2nix: prevPoetry2nix: {
    defaultPoetryOverrides = prevPoetry2nix.defaultPoetryOverrides.extend (final: prev: {
      gdal = prev.gdal.overridePythonAttrs (oldAttrs: {
        nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [final.numpy];
      });
    });
  })

results in "error: value is null while a set was expected"

01:36:36

Show newer messages


Back to Room ListRoom Version: 6