DavHau / mach-nix

Create highly reproducible python environments
MIT License
862 stars 106 forks source link

nixpkgs spyder: Automatic extraction of 'pname' from python package source /nix/store/a8g2zfzxh3v1hjnxz6839fjkq1caksmr-python3.8-spyder-4.1.5 failed. #207

Open InLaw opened 3 years ago

InLaw commented 3 years ago

does not work via packagesExtra (but via input in buildEnv/mkShell)


let
  ref = "refs/tags/3.1.1" ; processMode = "mksh"; versionPy = "38"; testPkgPy = ""; testPkgNix = "";
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix/";
    ref = "${ref}" ; 
  }) {  
      #pkgs= import <nixpkgs>  {config= { allowUnfree = true; }; };
      python = "python${versionPy}"; 
};
  nixPkgs = import mach-nix.nixpkgs.path {} ; 
  py = nixPkgs."python${versionPy}Packages" ;
in let
  envPy = mach-nix.mkPython rec {
    requirements =  ''
        ipython 
        jupyterlab
        pandas
        #scikit-learn 

        ${testPkgPy}

        #**PkgsPy**#

      ''; 

      packagesExtra = []
          ++ [
            # nixPkgs.spyder
          ]
      ; 

  }; 
in 
 # env = 
  nixPkgs.buildEnv rec { 
    name = "bEnvJL";    
    paths =
        [ (envPy) ]  
         ++ [
            nixPkgs.spyder
          ]
      ;
  }

error: Automatic extraction of 'pname' from python package source /nix/store/a8g2zfzxh3v1hjnxz6839fjkq1caksmr-python3.8-spyder-4.1.5 failed.
Please manually specify 'pname' 
DavHau commented 3 years ago

Actually python packages from nixpkgs should not be allowed via pkgsExtra. Mach-nix should raise a specific error in this case, but it seems like it doesn't. So this is the actual bug here that needs to be fixed.

InLaw commented 3 years ago

In this case spyder is the app (nixos package) not the python module (- but for python pkgs there is no error, too)

QAston commented 2 years ago

The readme says that nix packages are allowed, I have the same error when adding a package built with mach-nix.buildPythonApplication

QAston commented 2 years ago

It looks like the issue was fixed for me by switching to nixpkgs version 554d2d8aa25b6e583575459c297ec23750adb6cb

mohnishkodnani commented 2 years ago

I get the same for trying to also install pre-commit in python shell