!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

316 Members
https://github.com/nix-community/poetry2nix59 Servers

Load older messages


SenderMessageTime
13 Oct 2023
@schmittlauch:ohai.isschmittlauch (he/him) joined the room.18:20:32
@schmittlauch:ohai.isschmittlauch (he/him)

Hi there. I am currently migrating an old project towards poetry(2nix) and am running into a dependency issue with SQLAlchemy-1.4.49:

Executing pipInstallPhase
/build/SQLAlchemy-1.4.49/dist /build/SQLAlchemy-1.4.49
Processing ./SQLAlchemy-1.4.49-cp310-cp310-linux_x86_64.whl
ERROR: Could not find a version that satisfies the requirement greenlet!=0.4.17; python_version >= "3" and (platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))) (from sqlalchemy) (from versions: none)
ERROR: No matching distribution found for greenlet!=0.4.17; python_version >= "3" and (platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32"))))))
18:22:14
@schmittlauch:ohai.isschmittlauch (he/him) The initial poetry lock had succeeded in the cli, which is how I generated poetry.lcok in the first place. I am on nixpkgs-stable (23.05) and poetry2nix 1.41.0 18:23:16
@schmittlauch:ohai.isschmittlauch (he/him)Any ideas on this? To be fair, I still do not fully understand all components of poetry2nix.18:23:50
@schmittlauch:ohai.isschmittlauch (he/him)poetry.lock specifies greenlet as 2.0.218:26:48
@schmittlauch:ohai.isschmittlauch (he/him) Hmm, removing the markers from the dependendcy declaration fixes this, like described in https://github.com/nix-community/poetry2nix/issues/360 18:39:33
@schmittlauch:ohai.isschmittlauch (he/him)but that was for a different issue.18:39:52
15 Oct 2023
@net-mist:matrix.orgnet-mist joined the room.11:56:01
@dolcetriade:matrix.orgDolceTriade

How does one begin to debug an error like this...I would provide more context, but essentially I have a large pyproject.toml with a lot of dependencies and a lot of overrides for build systems and extra dependencies. I could bisect the pyproject.toml to identify the changes, but it seems there should be a better way to determine the cause of this error...

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'python-requirements'
         whose name attribute is located at /nix/store/g68f5abh3xhcz8xsdlfw7wkgkkcx3nwy-source/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'text' of derivation 'python-requirements'

         at /nix/store/g68f5abh3xhcz8xsdlfw7wkgkkcx3nwy-source/pkgs/build-support/trivial-builders/default.nix:148:16:

          147|     runCommand name
          148|       { inherit text executable checkPhase allowSubstitutes preferLocalBuild;
             |                ^
          149|         passAsFile = [ "text" ];

       error: function 'anonymous lambda' called with unexpected argument 'setuptools'

       at /nix/store/g68f5abh3xhcz8xsdlfw7wkgkkcx3nwy-source/pkgs/development/python-modules/wheel/default.nix:1:1:

            1| { lib
             | ^
            2| , buildPythonPackage
18:56:49
@dolcetriade:matrix.orgDolceTriadeI actually think this is due to a nixpkgs upgrade...18:59:11
@dolcetriade:matrix.orgDolceTriadeBut I'm still utterly baffled as to how this error happened and how to determine the root cause.19:00:08
@inkbottle:matrix.orgzebrag joined the room.21:27:26
16 Oct 2023
@dolcetriade:matrix.orgDolceTriadeAfter even more debugging, apparently, this is caused by the "wheel" dependency.03:56:09
@dolcetriade:matrix.orgDolceTriadeTurns out this is a bug in poetry2nix...https://github.com/nix-community/poetry2nix/blob/master/overrides/default.nix#L2864-L2867 but https://github.com/NixOS/nixpkgs/commit/3cd71e0ae67cc48f1135e55bf78cb0d67b53ff86 updated the wheel package to use flit-core. Seems we need to do a version check or something... Still have one other issue where evaluating my pyproject.toml eats up all my 16 GiB of RAM, but I'll see if I can create a minimal repro for this.05:35:05
@dolcetriade:matrix.orgDolceTriade

Hm, you can repro the memory hog by running (in the poetry2nix github repo):

nix flake update
nix build -L '.#githubActions.checks.x86_64-linux.wheel-wheel'

Seems like something is just broken.... Might need to do a bisect of nixpkgs :(

05:58:17
@dolcetriade:matrix.orgDolceTriade *

Hm, you can repro the memory hog by running (in the poetry2nix github repo) (you need to fix the args to wheel first):

nix flake update
nix build -L '.#githubActions.checks.x86_64-linux.wheel-wheel'

Seems like something is just broken.... Might need to do a bisect of nixpkgs :(

05:59:27
@jalr:jalr.de@jalr:jalr.de left the room.11:00:03
17 Oct 2023
@virtu:matrix.imvirtu joined the room.14:47:56
@virtu:matrix.imvirtu

Hey everyone. I was just made aware of the channel by someone on IRC so I'm reposting my original question here:

I'm trying to create a flake for one of my python code projects. I used nix flake init --template templates#full to create the flake and left it mostly untouched (except adding python = pkgs.${system}.python39; as argument to poetry2nix.mkPoetryEnv). I then added my dependencies with poetry add, which seemed to download the deps in some packaged form.

However, when I run nix develop or nix shell, it appears poetry isn't used to get the dependencies; instead, it looks like the nix is trying to build the dependencies. Is it supposed to be like that? If so, why use poetry and its lock file at all?

I'm sure there's a good reason for it, I'd just like to understand it. Because it appears not using poetry has, in my case, some unwanted side effects: nix fails to build some dependencies (quite common ones, too, like pandas).

Any help would be greatly appreciated. Here's the code I'm using, if that helps.

14:53:15
@k900:0upti.meK900Yes, it is supposed to be like that14:54:07
@k900:0upti.meK900The whole point of poetry2nix is that you're converting your poetry lock file to a Nix expression14:54:20
@k900:0upti.meK900So everything is built in Nix14:54:30
@virtu:matrix.imvirtuOkay, great. Makes sense. Converting the poetry lock file into a nix expression instead of relying on poetry, I mean.14:55:50
@virtu:matrix.imvirtu

Any ideas how to debug the problems building pandas and i2plib (another package I'm using)?

For pandas, it complains about a missing setup.py file and google didn't have any good pointers.

14:56:57
@virtu:matrix.imvirtu

The relevant part seems to be:

       > patching sources
       > Adding /nix/store/8r1v2mbnfri07zvblalna9xgdfnc763i-libcxx-11.1.0-dev/include/c++/v1 to the setup.py common_include variable
       > substitute(): ERROR: file 'setup.py' does not exist

And let me know if spamming error messages is discouraged.

14:58:10
@picog:matrix.orgPicoWhat version of pandas is that? 14:58:48
@picog:matrix.orgPicoI think we have pandas in one of our projects and I see an override for setuptools14:59:16
@k900:0upti.meK900Are you using poetry2nix from nixpkgs or from git master?14:59:59
@k900:0upti.meK900Also, are you using nixpkgs unstable or 23.05?15:00:14
@k900:0upti.meK900Try using poetry2nix from git master and nixpkgs 23.0515:00:20

Show newer messages


Back to Room ListRoom Version: 6