!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
16 Aug 2022
@skinnedcat:matrix.orgskinnedcat I'm trying to build poetry using poetry2nix like is done in nixpkgs. I need to pin to master. 23:35:56
@skinnedcat:matrix.orgskinnedcat

I'm getting some weird build failure, though, when I try to do this. It looks like the derivation is null?

$ nix build github:johnrichardrinehart/poetry-flake
error: value is null while a set was expected

       at /nix/store/p3bvy3abha8dihrczhsfmcvp3a87dwd2-source/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix:41:9:

           40|       else
           41|         drv.overridePythonAttrs (
             |         ^
           42|           old:
(use '--show-trace' to show detailed location information)
23:36:31
@skinnedcat:matrix.orgskinnedcat The flake is pretty simple and the pyproject.toml and poetry.lock came directly from python-poetry/poetry (which may be a mistake... not sure). 23:37:07
@skinnedcat:matrix.orgskinnedcat Before I created this flake I had tried modifying the nixpkgs source for poetry directly. But, I got the same result. 23:37:37
@skinnedcat:matrix.orgskinnedcatWhat is failing, here?23:38:32
17 Aug 2022
@skinnedcat:matrix.orgskinnedcatPosted this issue at https://github.com/nix-community/poetry2nix/issues/697 10:14:18
@skinnedcat:matrix.orgskinnedcat @adis:blad.is: I've been seeing the above issue in building poetry from the latest commit which has some changes that I want to use (https://github.com/python-poetry/poetry/issues/755). But, I'm a bit stuck on a problem with the derivation. If you have any bandwidth could you help me out or point me in the direction of someone who might know what's going on? 11:49:45
@greaka:greaka.degreaka joined the room.20:23:19
18 Aug 2022
@plato:matrix.orgplato

I'm not entirely sure if this is a poetry2nix issue, but in my build, I'm getting:

  File "/nix/store/g4064rhz6p4z9v8zbzfh2hr5afs9489s-python3.10-pip-22.1.2/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 179, in emit
    self.handleError(record)
Message: '[present-rich] %s'
Arguments: (UpgradePrompt(old='22.1.2', new='22.2.2'),)
Finished executing pipShellHook

as well as

FileNotFoundError: [Errno 2] No such file or directory: '/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/bin/pip'
11:36:12
@plato:matrix.orgplatoI'm sure this is the damn pip upgrade hook, but that doesn't make a lot of sense with Nix anyways - can I disable it easily?11:36:35
21 Aug 2022
@greaka:greaka.degreaka changed their display name from greaka ⚡️ to greaka .09:25:58
@jeff:ocjtech.usJeff

Trying to package a simple Python/Gtk app, but I'm running into this:

Traceback (most recent call last):
  File "/nix/store/1dk4vbp3bgvz26bv0lf7n1lqa973ixhd-python3.10-gnome-random-background-0.1.0/bin/.gnome-choose-random-background-wrapped", line 6, in <module>
    from gnome_random_background.main import choose_random_background
  File "/nix/store/1dk4vbp3bgvz26bv0lf7n1lqa973ixhd-python3.10-gnome-random-background-0.1.0/lib/python3.10/site-packages/gnome_random_background/main.py", line 6, in <module>
    gi.require_version("Gtk", "4.0")
  File "/nix/store/lhw4cvfapk2dwhz6fsac4cv0awibbm9m-python3.10-pygobject-3.42.2/lib/python3.10/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

Source is at https://git.ocjtech.us/jeff/gnome-random-background if anyone can help me get this going.

23:59:26
22 Aug 2022
@adis:blad.isadisbladis
In reply to @jeff:ocjtech.us

Trying to package a simple Python/Gtk app, but I'm running into this:

Traceback (most recent call last):
  File "/nix/store/1dk4vbp3bgvz26bv0lf7n1lqa973ixhd-python3.10-gnome-random-background-0.1.0/bin/.gnome-choose-random-background-wrapped", line 6, in <module>
    from gnome_random_background.main import choose_random_background
  File "/nix/store/1dk4vbp3bgvz26bv0lf7n1lqa973ixhd-python3.10-gnome-random-background-0.1.0/lib/python3.10/site-packages/gnome_random_background/main.py", line 6, in <module>
    gi.require_version("Gtk", "4.0")
  File "/nix/store/lhw4cvfapk2dwhz6fsac4cv0awibbm9m-python3.10-pygobject-3.42.2/lib/python3.10/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

Source is at https://git.ocjtech.us/jeff/gnome-random-background if anyone can help me get this going.

I think propagating gtk is not enough, you'll need to set some env var (I don't know which one)
05:07:55
@adis:blad.isadisbladis Propagating it would only serve to add it to $PATH and for hooks to be able to pick up the input 05:08:23
@adis:blad.isadisbladis But at runtime it's all up to the generated wrapper which doesn't know how to do anything sensible for gi to know about gtk 05:08:47
@adis:blad.isadisbladisI think using wrapgappshook would fix it05:12:54
@adis:blad.isadisbladis
diff --git a/flake.nix b/flake.nix
index 92490f7..5e0302f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -28,6 +28,9 @@
           gnome-random-background = pkgs.poetry2nix.mkPoetryApplication {
             python = pkgs.python310;
             projectDir = ./.;
+            nativeBuildInputs = [
+              pkgs.wrapGAppsHook
+            ];
             propagatedBuildInputs = [
               pkgs.cairo
               pkgs.gobject-introspection
05:13:02
@adis:blad.isadisbladis(it didn't actually work)05:21:11
@adis:blad.isadisbladisThis gobject stuff is an absolute packaging nightmare05:21:21
@adis:blad.isadisbladisBut I think that's the functionality you're looking for05:23:34
@jeff:ocjtech.usJeffyeah, just adding wrapGAppsHook didn't do anything, maybe it doesn't know how to wrap a python app?15:33:53
23 Aug 2022
@callmeecho:matrix.orgEcho joined the room.00:49:09
@plato:matrix.orgplato I'd like to have a derivation that includes not just my poetry.scripts (which are in Python) but also an external script that calls my Python application (think gunicorn). The docs mention dependencyEnv, but don't indicate how to create a standalone script that uses it. 06:55:42
@gmacon:matrix.orggmacon On Linux, with https://github.com/gmacon/poetry2nix-simple-numpy-failure, nix build .#app fails the tests because it cannot find libgfortran while importing numpy. If you use a shell from poetry shell instead, pytest can find libgfortran, but a Python REPL cannot. If you remove the tool.poetry.source block from pyproject.toml and run poetry lock then everything works OK. Does anyone have any idea what could be the problem here? 18:06:52
@bryan.bennett:matrix.orgBryan joined the room.18:44:41
24 Aug 2022
@ethanabrooks:matrix.orgEthan Brooks

Hello, I was hoping I could get help with the following error:

error: collision between `/nix/store/6f3p70mq7hdpsd6g87chp5pypklkkvv8-python3.9-optax-0.1.3/lib/python3.9/site-packages/docs/conf.py' and `/nix/store/lw3a5zgbb27cy0y5j4k9n1n1dnnbx34b-python3.9-ml_collections-0.1.1/lib/python3.9/site-packages/docs/conf.py'
18:59:09
@ethanabrooks:matrix.orgEthan Brooks I have a minimal flake.nix/pyproject.toml to reproduce. 19:00:27
@bryan.bennett:matrix.orgBryan Ethan Brooks: This looks to be a similar problem? https://github.com/nix-community/poetry2nix/issues/46 19:26:05
@bryan.bennett:matrix.orgBryan I think you'll need to investigate optax and ml_collections and see what needs to happen. I suspect that both packages use sphinx (that's the conf.py, right?) and it would simply be safe to remove the docs subdirectory from one or both. If you're using preferWheels, it's marginally more difficult (you need to unpack and repack the wheel, I think). 19:29:48
@ethanabrooks:matrix.orgEthan BrooksHi Bryan thanks for the response. So is the issue that they require different versions of sphinx? What exactly is colliding with what?19:43:52

Show newer messages


Back to Room ListRoom Version: 6