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

python.analysis.exclude is not working. #6744

Open
Tinyu-Zhao opened this issue Dec 6, 2024 · 0 comments
Open

python.analysis.exclude is not working. #6744

Tinyu-Zhao opened this issue Dec 6, 2024 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@Tinyu-Zhao
Copy link

Environment data

  • Pylance version: 2024.12.1
  • OS and version: macOS14.7.1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.0

Repro Steps

  1. In .vscode/settings.json under the workspace add
    “python.analysis.exclude": [
    “/Users/tinyu/.vscode/extensions/ms-python.vscode-pylance-2024.11.2/dist/typeshed-fallback/stdlib/time.pyi” ]. ].
    ], .
    and add
    “python.analysis.include": [
    “/Users/tinyu/Developer/Code/uiflow_micropython/build-code-snippet/mpy/pyi"]. .
    ], .
    “python.autoComplete.extraPaths": [
    “. /build-code-snippet/mpy/pyi”, [. /build-code-snippet/mpy/pyi”.
    “. /m5stack/libs”,
    “. /micropython”.
    ], .
    “python.analysis.extraPaths": [
    “. /build-code-snippet/mpy/pyi”, [. /build-code-snippet/mpy/pyi”.
    “. /m5stack/libs”,
    “. /micropython”.
    ], .

  2. Add the file /build-code-snippet/mpy/pyi to your workspace directory, download it from https://makingfun.oss-cn-qingdao.aliyuncs.com/m5stack/temp/micropython-pyi.zip.

Expected behavior

time.sleep_ms is imported properly, time.sleep_ms no longer has the red wavy line

Actual behavior

time.sleep_ms is prompted not to exist in time
Image

Note: sleep_ms is explicitly defined in /build-code-snippet/mpy/pyi/time.pyi.

def sleep_ms(ms: int, /) -> None:
    """
   Delay for given number of milliseconds, should be positive or 0.
   
   This function will delay for at least the given number of milliseconds, but
   may take longer than that if other processing must take place, for example
   interrupt handlers or other threads.  Passing in 0 for *ms* will still allow
   this other processing to occur.  Use `sleep_us()` for more precise delays.
   """

Replace time.pyi with /build-code-snippet/mpy/pyi/time.pyi in the pylance stub file in vscode and the red wavy line disappears.
Image
And you can find the definition correctly
Image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants