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

Request to remove mypy hardcoded config - python_executable #742

Open
sagarc03 opened this issue Feb 23, 2025 · 1 comment · May be fixed by #743
Open

Request to remove mypy hardcoded config - python_executable #742

sagarc03 opened this issue Feb 23, 2025 · 1 comment · May be fixed by #743

Comments

@sagarc03
Copy link

'--python-executable',
function()
return vim.fn.exepath 'python3' or vim.fn.exepath 'python'
end

The above config in mypy linter config causes python_executable to be hard coded to whatever the first executable in path. From mypy's website

When options conflict, the precedence order for configuration is:

  1. Inline configuration in the source file
  2. Sections with concrete module names (foo.bar)
  3. Sections with “unstructured” wildcard patterns (foo.*.baz), with sections later in the configuration file overriding sections earlier.
  4. Sections with “well-structured” wildcard patterns (foo.bar.*), with more specific overriding more general.
  5. Command line options.
  6. Top-level configuration file options.

While other hardcoded config are required for it to play nicely with nvim's diagnostics, python_executable is a user preferred setting. It doesn't have to be in the path and can be anywhere in the user system. It should be left upto the user to configure it using config files.

@sagarc03 sagarc03 linked a pull request Feb 23, 2025 that will close this issue
@sagarc03
Copy link
Author

If I am not wrong this will also fix problems mention in #662.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant