DavHau / mach-nix

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

Creating python27 environments with mach-nix not working #437

Open EmperorDali opened 2 years ago

EmperorDali commented 2 years ago

Hi there,

I'm unable to create python27 environments with mach-nix. This minimal example:

{
  description = "Python 2 Environment";

  inputs = {
    mach-nix.url = "mach-nix/3.4.0";
  };

  outputs = { self, nixpkgs, mach-nix }:
      let
        l = nixpkgs.lib // builtins;
        supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
        forAllSystems = f: l.genAttrs supportedSystems
          (system: f system (import nixpkgs {inherit system;}));
      in
        {
          devShell = forAllSystems (system: pkgs:
            let
              python-env = mach-nix.lib."${system}".mkPython {
                python = "python27";

              };

            in                  
              pkgs.mkShell {
                buildInputs =  [
                  python-env
                ];
              });
        };
}

fails with

error: buildbot-3.4.0 not supported for interpreter python2.7
EmperorDali commented 2 years ago

A bit more data on this:

The proximal issue seems to be that as nixpkgs evolves python 2 packages in nixpkgs.pythonPackages will stop working since upstream packages are dropping support for 2.7. In this case the version of nixpkgs.pythonPackages.buildbot in the recent version of nixpkgs I'm using has dropped support for 2.7.

It seems like we should still be able to move forward though - buildbot is (presumably) a mach-nix dependency, since I'm creating an empty 2.7 environment here. I'm not sure why mach-nix is attempting to pull in buildbot against 2.7, since I'm guessing mach-nix itself uses python 3.

DrPyser commented 1 year ago

Also having this issue. Is there a working path to get a python 2 environment?