!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

322 Members
https://github.com/nix-community/poetry2nix64 Servers

Load older messages


SenderMessageTime
14 Aug 2024
@lambadada:matrix.orglambadada
In reply to @truh:matrix.org
maybe the problem is that your source for torch only has wheels and no source tarball
*

I know nix is a source-first distro, but is that what's causing my issue? On line 35 in flake.nix at the link you can see that I don't have a SHA hash yet. I don't have a SHA hash yet because the flake halts execution well before it reaches the stage where it cares whether it has received source code or a wheel.

As per your advice, I tried following the recommendations for using wheels in this commit. It did not fix my issue. I'm not sure I did it right, could you provide more details?

17:49:16
@lambadada:matrix.orglambadada *

I know nix is a source-first distro, but is that what's causing my issue? On line 35 in flake.nix at the link you can see that I don't have a SHA hash yet. I don't have a SHA hash yet because the flake halts execution well before it reaches the stage where it cares whether it has received source code or a wheel.

As per your advice, I tried following the recommendations for using wheels in this commit. there is no change to the error displayed. I'm not sure I did it right, could you provide more details?

17:49:53
16 Aug 2024
@nebucatnetzer13:matrix.orgnebucatnetzer13 set a profile picture.11:05:59
19 Aug 2024
@alejandrosame:matrix.org@alejandrosame:matrix.org left the room.08:51:43
20 Aug 2024
@roastedcheesee:matrix.org@roastedcheesee:matrix.org left the room.12:46:33
21 Aug 2024
@adis:blad.isadisbladis

This is quite a radical change I'm considering for poetry2nix v2:

The API comes down to one central function mkOverlay:

let
  python = pkgs.python3.override {
    self = python;
    packageOverrides =
      lib.composeExtensions
      (poetry2nix.mkOverlay {
        projectRoot = ./.;
      })
      poetry2nix.overrides
  };
in
   ...

In this brave new world I'm having two considerations I'm not sure about:

  • Where does preferWheel(s) belong? Is this actually the correct mechanism for sdist/wheel preference order?

  • Where does PEP-508 marker customisation belong?
    This is not currently something you can do with poetry2nix, but it's something I'm adding.

04:42:01
@adis:blad.isadisbladis You might argue that this belongs in mkOverlay, but the overlay generated is for any interpreter 04:42:19
@adis:blad.isadisbladisMaybe this is an internal overlay attribute?04:42:39
@adis:blad.isadisbladisBut that's also a bit funky04:42:45
@adis:blad.isadisbladisIdeas welcome04:42:47
@adis:blad.isadisbladis * You might argue that PEP-508 markers belongs in mkOverlay, but the overlay generated is for any interpreter 04:47:44
@adis:blad.isadisbladis I think wheel preference or not is so central to the user experience that it should probably be an mkOverlay thing 04:48:08
@adis:blad.isadisbladisBut marker customisation feels wrong there04:48:20
@adis:blad.isadisbladis *

This is quite a radical change I'm considering for poetry2nix v2:

The API comes down to one central function mkOverlay:

let
  python = pkgs.python3.override {
    self = python;
    packageOverrides =
      lib.composeExtensions
      (poetry2nix.mkOverlay {
        projectRoot = ./.;
      })
      poetry2nix.overrides
  };
in
   ...

In this brave new world I'm having two considerations I'm not sure about:

  • Where does preferWheel(s) belong? Is this actually the correct mechanism for sdist/wheel preference order?
  • Where does PEP-508 marker customisation belong?
    This is not currently something you can do with poetry2nix, but it's something I'm adding.
05:21:46
@adis:blad.isadisbladisInternals are coming along https://adisbladis.github.io/poetry2nix-v2/lib/metadata2.html09:07:30
@truh:matrix.orgtruhSo I would then use python.pkgs.<my-project-name> instead of the output of mkPoetryApplication?09:39:45
@adis:blad.isadisbladis
In reply to @truh:matrix.org
So I would then use python.pkgs.<my-project-name> instead of the output of mkPoetryApplication?
That's the idea
09:44:46
@truh:matrix.orgtruhSounds good, maybe a bit more difficult to get the hang of for people who aren't familiar nixpkgs.10:03:03
@truh:matrix.orgtruhWould 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 problems10:07:53
@adis:blad.isadisbladis
In reply to @truh:matrix.org
Sounds good, maybe a bit more difficult to get the hang of for people who aren't familiar nixpkgs.
For sure it's a little bit more friction, OTOH this API gives you a gradual learning path.
Another agenda with keeping it as simple as possible is for future compat with https://github.com/NixOS/nixpkgs/issues/272178
10:21:50
@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

Show newer messages


Back to Room ListRoom Version: 6