microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Pyc files should make the reportMissingModuleSource error not show up #6226

Open rchiodo opened 1 month ago

rchiodo commented 1 month ago

Hi I am facing a similar issue

I package my python application into a wheel file .pyc and .pyi files

Pylance reports the following error since it expects .py files

Import "module.path" could not be resolved from sourcePylance[reportMissingModuleSource](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportMissingModuleSource)

If I add a pyright config to the root of my project as follows, it seems to resolve my issue


{

    "reportMissingModuleSource": false

}

However I was wondering if any config could be added to include .pyc files when checking for the module path alone, I have both pyc and pyi files in the same directory

Originally posted by @abishek-rz in #242

heejaechang commented 1 month ago

I thought we already do this. we might have broken something or pyc file is not following naming convention we use to match pyc to pyi.

abishek-rz commented 1 month ago

Hi @heejaechang I am using the same name for both the stub file and pyc file The paths are also same Only the file extension is different I am Using only underscores and alphabets in the name