Closed
Description
With the following configuration
languages.python = {
enable = true;
directory = "./mypythonproject";
version = "3.11.10";
uv = {
enable = true;
sync.enable = true;
};
};
packages = with pkgs; [
pyright
];
git-hooks.hooks.pyright = {
enable = true;
package = pkgs.pyright; # For consistency with packages above
args = [ "--warnings" ]; # Make it fail if warnings are present
};
pyright will not run in the virtual environment that uv
created, leading to it not detecting packages that would otherwise be available, so it can't properly typecheck.
e.g.
with pyproject.toml
[project]
dependencies = [
"requests>=2.28.2",
]
description = "Add your description here"
name = "myproject"
readme = "README.md"
requires-python = "==3.11.10"
version = "0.0.0"
python code:
import requests
we get:
warning: Import "requests" could not be resolved from source (reportMissingModuleSource)
0 errors, 1 warning, 0 informations
Metadata
Metadata
Assignees
Labels
No labels