nix-community / poetry2nix

Convert poetry projects to nix automagically [maintainer=]
MIT License
892 stars 452 forks source link

Poetry2nix not using wheels even with `preferWheels = true` #362

Closed tfmoraes closed 3 years ago

tfmoraes commented 3 years ago

I create this github repository to show this problem: https://github.com/tfmoraes/poetry2nix_test

In this repository I used Niv to lock the Nixpkgs version (last in nixos-unstable) and Poetry2nix (also the last version). The project in this repository has two dependencies: numpy and cython. It uses poetry2nix.mkPoetryEnv to create a python environment with those two packages installed. I set it use wheels (preferWheels = true). But it's not using the wheels.

nixos-discourse commented 3 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/another-good-way-to-package-python-packages-from-pypi/14647/16

tijolao commented 3 years ago

this is happening to me too.

imincik commented 3 years ago

I confirm this issue as well. I am trying to avoid building numpy from source using following code, but it doesn't work

pkgs.poetry2nix.mkPoetryApplication {
    python = pkgs.python38;
    projectDir = builtins.path { path = ./.; name = "xyz"; };
    src = ./.;
    doCheck = false;
    overrides = 
        pkgs.poetry2nix.overrides.withDefaults (self: super: {

            # Use Python wheel to avoid lengthy compilation from source code
            numpy = super.numpy.override {
                preferWheel = true;
            };

        });
imincik commented 3 years ago

@adisbladis , I just found that test_preferwheel.py is empty file.

imincik commented 3 years ago

But setting global preferWheels = true works !

Example:

pkgs.poetry2nix.mkPoetryApplication {
    python = pkgs.python38;
    projectDir = builtins.path { path = ./.; name = "xyz"; };
    src = ./.;
    doCheck = false;
    preferWheels = true;  
tfmoraes commented 3 years ago

I tested here and preferWheels is working now.

rossng commented 1 year ago

Do you know if the issue with preferWheel was ever resolved? I have been able to use preferWheels but not preferWheel.