the-nix-way / dev-templates

Dev environments for numerous languages based on Nix flakes [maintainer=@lucperkins]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tweaked Python file throws error

alper opened this issue · comments

I ended up with this:

flake-utils.lib.eachDefaultSystem (system:
    let
      # overlays = [
      #   (self: super: {
      #     python = super.python311;
      #   })
      # ];

      # pkgs = import nixpkgs { inherit overlays system; };
      pkgs = import nixpkgs { inherit system; };
    in
    {
      devShells.default = pkgs.mkShell {
        packages = with pkgs; [ python311 virtualenv protobuf ] ++
          (with pkgs.python311Packages; [ pip protobuf ]);

        shellHook = ''
          ${pkgs.python}/bin/python --version
        '';
      };
    });

Don't really see the point of the overlay or of mach-nix.

which is giving me this error:

error: builder for '/nix/store/8v2nc3j1z6m1k3fzw51nn8sxlmxjp0h0-python3.11-pyext-0.8.drv' failed with exit code 1;
       last 10 log lines:
       > Executing setuptoolsBuildPhase
       > Traceback (most recent call last):
       >   File "/private/tmp/nix-build-python3.11-pyext-0.8.drv-0/source/nix_run_setup", line 8, in <module>
       >     exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
       >   File "setup.py", line 6, in <module>
       >     import pyext
       >   File "/private/tmp/nix-build-python3.11-pyext-0.8.drv-0/source/pyext.py", line 118, in <module>
       >     oargspec = inspect.getargspec
       >                ^^^^^^^^^^^^^^^^^^
       > AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
       For full logs, run 'nix log /nix/store/8v2nc3j1z6m1k3fzw51nn8sxlmxjp0h0-python3.11-pyext-0.8.drv'.
error: 1 dependencies of derivation '/nix/store/45hvqqc10rgqjyn716cpb23x3xf2qhq1-python3.11-protobuf-4.21.8.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ixisv4p5j0yw8l9d8a372x7xg3gyic5q-nix-shell-env.drv' failed to build

Not sure what is happening here.

I tried your code snippet (now without mach-nix) and got a different error. But switching the Nixpkgs revision to nixpkgs-unstable worked just fine for me. I'd recommend doing that and running nix flake update. I'm actually going to go through and switch all of these templates to nixpkgs-unstable, as the current release is getting pretty old 👴🏼