Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] error: attribute 'propagatedBuildInputs' missing in pylsp support #1894

Closed
1 task done
vsiles opened this issue Jul 19, 2024 · 11 comments
Closed
1 task done

[BUG] error: attribute 'propagatedBuildInputs' missing in pylsp support #1894

vsiles opened this issue Jul 19, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@vsiles
Copy link

vsiles commented Jul 19, 2024

Field Description
Plugin lsp
Nixpkgs github:nixos/nixpkgs/af9c15bc7a314c226d7d5d85e159f7a73e8d9fae
Home Manager github:nix-community/home-manager/afd2021bedff2de92dfce0e257a3d03ae65c603d
  • I have read the FAQ and my bug is not listed there.

Description

After updating my setup with nix flake update, I get the following error on nix flake check or home-manager switch:

error:
       … while checking flake output 'checks'
         at /nix/store/hrcpxll4nfdvzn3a80n1shrddkj10y69-source/flake.nix:187:7:
          186|       # for every architecture. Here, our derivation is mac-dependent, so it doesn't really matter.
          187|       checks.aarch64-darwin = { canBuild = mac.system; };
             |       ^
          188|       checks.x86_64-linux = { canBuild = linux.activationPackage; };

       … while checking the derivation 'checks.aarch64-darwin.canBuild'
         at /nix/store/hrcpxll4nfdvzn3a80n1shrddkj10y69-source/flake.nix:187:33:
          186|       # for every architecture. Here, our derivation is mac-dependent, so it doesn't really matter.
          187|       checks.aarch64-darwin = { canBuild = mac.system; };
             |                                 ^
          188|       checks.x86_64-linux = { canBuild = linux.activationPackage; };

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'propagatedBuildInputs' missing
       at /nix/store/ak4s54jqdq5yhpsc2l7xahr06b4ib0qn-source/plugins/lsp/language-servers/pylsp.nix:542:90:
          541|                   # Get rid of the python-lsp-server dependency
          542|                   propagatedBuildInputs = filter (dep: dep.pname != "python-lsp-server") old.propagatedBuildInputs;
             |                                                                                          ^
          543|

No change to my local nix files has been done (here is my plugin config: https://github.com/vsiles/config/blob/master/home-manager/lsp.nix#L45)

Minimal, Reproducible Example (MRE)

programs.nixvim = {
  plugins = {
    lsp = {
      servers = {
                    pylsp = {
                        enable = true;
                        settings = {
                            configurationSources = "flake8";
                            plugins = {
                                pycodestyle.enabled = false;
                                mccabe.enabled = false;
                                pyflakes.enabled = false;
                                mypy.enabled = true;
                                black = {
                                    enabled = true;
                                    lineLength = 120;
                                };
                                isort.enabled = true;
                                flake8 = {
                                    enabled = true;
                                    maxLineLength = 120;
                                };
                            };
                        };
                    };
    };
  };
}
@vsiles vsiles added the bug Something isn't working label Jul 19, 2024
@MattSturgeon
Copy link
Member

For now, try removing any "follows" lines affecting nixvim in your flake inputs and re-run nix flake lock.

See #1893 (comment)

@vsiles
Copy link
Author

vsiles commented Jul 19, 2024

I'll get a look, thanks !

@charludo
Copy link

For now, try removing any "follows" lines affecting nixvim in your flake inputs and re-run nix flake lock.

See #1893 (comment)

No luck, unfortunately. (Not OP, but same error)

@charludo
Copy link

For now, try removing any "follows" lines affecting nixvim in your flake inputs and re-run nix flake lock.
See #1893 (comment)

No luck, unfortunately. (Not OP, but same error)

Edit: disabling ruff solves the issue (programs.nixvim.plugins.lsp.servers.pylsp.settings.plugins.ruff.enabled = false;). That's an OK workaround for me for now.

I am a bit confused though because this doesn't appear to have anything to do with pylsp-rope mentioned in #1893, unless I am mistaken?

@vsiles
Copy link
Author

vsiles commented Jul 19, 2024

For now, try removing any "follows" lines affecting nixvim in your flake inputs and re-run nix flake lock.
See #1893 (comment)

No luck, unfortunately. (Not OP, but same error)

Edit: disabling ruff solves the issue (programs.nixvim.plugins.lsp.servers.pylsp.settings.plugins.ruff.enabled = false;). That's an OK workaround for me for now.

I am a bit confused though because this doesn't appear to have anything to do with pylsp-rope mentioned in #1893, unless I am mistaken?

Can you share your config ? I tried disabling ruff and it didn't fix it for me. I'll try to do the follows fix too.

@charludo
Copy link

For now, try removing any "follows" lines affecting nixvim in your flake inputs and re-run nix flake lock.
See #1893 (comment)

No luck, unfortunately. (Not OP, but same error)

Edit: disabling ruff solves the issue (programs.nixvim.plugins.lsp.servers.pylsp.settings.plugins.ruff.enabled = false;). That's an OK workaround for me for now.
I am a bit confused though because this doesn't appear to have anything to do with pylsp-rope mentioned in #1893, unless I am mistaken?

Can you share your config ? I tried disabling ruff and it didn't fix it for me. I'll try to do the follows fix too.

This is everything relating to python that I have:

{ pkgs, ... }:
{
  programs.nixvim.plugins.lsp.servers.pylsp = {
    enable = true;
    filetypes = [ "python" ];
    settings.plugins = {
      black.enabled = true;
      black.line_length = 88;

      isort.enabled = true;
      pylint.enabled = true;

      pycodestyle.enabled = true;
      pycodestyle.maxLineLength = 88;
      pycodestyle.ignore = [ "E501" "W503" "R0903" ];

      # pylsp_mypy.enabled = true;
      # pylsp_mypy.dmypy = true;

      ruff.enabled = false;
      ruff.lineLength = 88;
    };
  };
  programs.nixvim.plugins.lint.lintersByFt.python = [ "pylint" ];
  programs.nixvim.extraPackages = [ pkgs.pylint pkgs.ruff ];
  home.shellAliases.ruff = "${pkgs.ruff}/bin/ruff";
}

I kept my follows ... though.

@vsiles
Copy link
Author

vsiles commented Jul 19, 2024

Looks like adding the follows workaround and the ruff disable works for me !
Hopefully this will be fixed upstream :D Thank you !

I spoke too soon. Still the same error.

@MattSturgeon
Copy link
Member

If you have a newer nixpkgs lock than us then any number of python packages may affect you, since we have yet to update our implementation to match the very latest nixpkgs.

It's also possible for nixpkgs differences to affect you even if the relevant options are not enabled, because the modules still get evaluated.


If disabling follows doesn't help then it's possible we're already locked to an affected nixpkgs rev (but that doesn't make sence, since our test suite should've noticed)...

@traxys
Copy link
Member

traxys commented Jul 19, 2024

follows don't affect the home-manager & nixos moddules, it only affects the standalone configuration

@MattSturgeon
Copy link
Member

follows don't affect the home-manager & nixos moddules, it only affects the standalone configuration

Ah yes, you're right. #1784 could eventually allow a solution to that; we could have something similar to home-manager's useGlobalPkgs option.

hyperpastel added a commit to hyperpastel/kirara-nixvim that referenced this issue Jul 23, 2024
@PerchunPak
Copy link
Contributor

This should be fixed by 9f9e202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants