pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Pylance is extremly slow with 'transformers' package

Open Guillaume-Lombardo opened this issue 4 months ago • 9 comments

Type: Bug

I'm not sure how to reproduce. I've 8 python file opened (all my code is type hinted). I use the following dependencies and use node v22.20.0 as node binaries.


requirements.txt fastapi httptools httpx nest-asyncio openai-whisper orjson polars pyannote.audio pydantic pydantic-settings python-dotenv starlette structlog torch torchcodec transformers uvicorn uvloop

requirements-dev.txt build bump2version esbonio flake8 ipykernel ipywidgets myst-parser pip pre-commit pytest pytest-asyncio pytest-cov pytest-mock pytest-sugar python-dotenv ruff sphinx sphinx-rtd-theme tox twine types-PyYAML watchdog wheel

Extension version: 2025.4.1 VS Code version: Code 1.95.2 (e8653663e8840adaf45af01eab5c627a5af81807, 2024-11-07T11:07:22.054Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 4.18.0-553.33.1.el8_10.x86_64 Remote OS version: Linux x64 4.18.0-553.33.1.el8_10.x86_64 Remote OS version: Linux x64 4.18.0-553.33.1.el8_10.x86_64 Remote OS version: Linux x64 4.18.0-553.33.1.el8_10.x86_64

System Added Logs
2025-10-07 08:59:17.587 [info] [Info  - 8:59:17 AM] (3830753) Server root directory: file:///home/idaia/appli/data/users/f838079/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-10-07 08:59:17.619 [info] [Info  - 8:59:17 AM] (3830753) Pylance language server 2025.4.1 (pyright version 1.1.398, commit 4f24eccc) starting
2025-10-07 08:59:17.621 [info] [Info  - 8:59:17 AM] (3830753) Starting service instance "plume2" for workspace "/home/idaia/appli/data/users/f838079/git/plume2"
2025-10-07 08:59:18.203 [info] [Info  - 8:59:18 AM] (3830753) Loading pyproject.toml file at /home/idaia/appli/data/users/f838079/git/plume2/pyproject.toml
2025-10-07 08:59:18.213 [info] [Info  - 8:59:18 AM] (3830753) Setting environmentName for service "plume2": "3.13.5 (plume2 venv)"
2025-10-07 08:59:18.215 [info] [Info  - 8:59:18 AM] (3830753) Setting pythonPath for service "plume2": "/home/idaia/appli/data/users/f838079/git/plume2/.venv/bin/python"
2025-10-07 08:59:18.215 [info] [Info  - 8:59:18 AM] (3830753) No include entries specified; assuming /home/idaia/appli/data/users/f838079/git/plume2
2025-10-07 08:59:18.235 [info] (Client) Pylance async client (2025.4.1) started with python extension (2025.14.0)
2025-10-07 08:59:18.291 [info] [Info  - 8:59:18 AM] (3830753) Assuming Python version 3.13.6.final.0
2025-10-07 08:59:29.225 [info] [Info  - 8:59:29 AM] (3830753) Found 43230 source files
2025-10-07 08:59:29.280 [info] [Info  - 8:59:29 AM] (3830753) BG: Priority queue background worker(2) root directory: file:///home/idaia/appli/data/users/f838079/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-10-07 08:59:29.281 [info] [Info  - 8:59:29 AM] (3830753) BG: Priority queue background worker(2) started
2025-10-07 08:59:29.282 [info] [Info  - 8:59:29 AM] (3830753) Loading pyproject.toml file at /home/idaia/appli/data/users/f838079/git/plume2/pyproject.toml
2025-10-07 08:59:29.283 [info] [Info  - 8:59:29 AM] (3830753) Setting environmentName for service "plume2": "3.13.5 (plume2 venv)"
2025-10-07 08:59:29.284 [info] [Info  - 8:59:29 AM] (3830753) Setting pythonPath for service "plume2": "/home/idaia/appli/data/users/f838079/git/plume2/.venv/bin/python"
2025-10-07 08:59:29.284 [info] [Info  - 8:59:29 AM] (3830753) No include entries specified; assuming /home/idaia/appli/data/users/f838079/git/plume2
2025-10-07 08:59:29.341 [info] [Info  - 8:59:29 AM] (3830753) Assuming Python version 3.13.6.final.0
2025-10-07 08:59:39.012 [info] [Info  - 8:59:39 AM] (3830753) Found 43230 source files
2025-10-07 08:59:39.895 [info] [Info  - 8:59:39 AM] (3830753) BG: Indexer background runner(3) root directory: file:///home/idaia/appli/data/users/f838079/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist (index)
2025-10-07 08:59:39.895 [info] [Info  - 8:59:39 AM] (3830753) BG: Indexing(3) started
2025-10-07 08:59:41.437 [info] [Info  - 8:59:41 AM] (3830753) BG: scanned(3) 386 files over 1 exec env
2025-10-07 08:59:42.598 [info] [Info  - 8:59:42 AM] (3830753) BG: indexed(3) 386 files over 1 exec env
2025-10-07 08:59:42.687 [info] [Info  - 8:59:42 AM] (3830753) BG: [BG(1)] Long operation: SemanticTokens range 161:0 - 225:15 at file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript_one_by_one.py (3123ms)
2025-10-07 08:59:42.977 [info] [Info  - 8:59:42 AM] (3830753) BG: Indexing finished(3).
2025-10-07 09:00:02.152 [info] [Warn  - 9:00:02 AM] (3830753) BG: Workspace indexing has hit its upper limit: 2000 files
2025-10-07 09:00:56.194 [info] [Info  - 9:00:56 AM] (3830753) Loading pyproject.toml file at /home/idaia/appli/data/users/f838079/git/plume2/pyproject.toml
2025-10-07 09:00:56.194 [info] [Info  - 9:00:56 AM] (3830753) Setting environmentName for service "plume2": "3.13.5 (plume2 venv)"
2025-10-07 09:00:56.197 [info] [Info  - 9:00:56 AM] (3830753) Setting pythonPath for service "plume2": "/home/idaia/appli/data/users/f838079/git/plume2/.venv/bin/python"
2025-10-07 09:00:56.198 [info] [Info  - 9:00:56 AM] (3830753) No include entries specified; assuming /home/idaia/appli/data/users/f838079/git/plume2
2025-10-07 09:00:56.260 [info] [Info  - 9:00:56 AM] (3830753) Assuming Python version 3.13.6.final.0
2025-10-07 09:01:07.821 [info] [Info  - 9:01:07 AM] (3830753) Found 43230 source files
2025-10-07 09:01:08.689 [info] [Info  - 9:01:08 AM] (3830753) BG: Indexer background runner(4) root directory: file:///home/idaia/appli/data/users/f838079/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist (index)
2025-10-07 09:01:08.689 [info] [Info  - 9:01:08 AM] (3830753) BG: Indexing(4) started
2025-10-07 09:01:09.627 [info] [Info  - 9:01:09 AM] (3830753) BG: scanned(4) 386 files over 1 exec env
2025-10-07 09:01:10.460 [info] [Info  - 9:01:10 AM] (3830753) BG: indexed(4) 386 files over 1 exec env
2025-10-07 09:01:10.783 [info] [Info  - 9:01:10 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript_one_by_one.py (2509ms)
2025-10-07 09:01:10.783 [info] [Info  - 9:01:10 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript_one_by_one.py (2723ms)
2025-10-07 09:01:10.783 [info] [Info  - 9:01:10 AM] (3830753) BG: Indexing finished(4).
2025-10-07 09:01:27.431 [info] [Info  - 9:01:27 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (16490ms)
2025-10-07 09:01:27.451 [info] [Info  - 9:01:27 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (16543ms)
2025-10-07 09:01:28.516 [info] [Info  - 9:01:28 AM] (3830753) BG: [BG(1)] Long operation: SemanticTokens range 0:0 - 52:53 at file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (17720ms)
2025-10-07 09:01:45.507 [info] [Warn  - 9:01:45 AM] (3830753) BG: Workspace indexing has hit its upper limit: 2000 files
2025-10-07 09:02:13.936 [info] [Info  - 9:02:13 AM] (3830753) Found 42701 source files
2025-10-07 09:02:32.217 [info] [Info  - 9:02:32 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (15156ms)
2025-10-07 09:02:32.225 [info] [Info  - 9:02:32 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (15198ms)
2025-10-07 09:02:33.271 [info] [Info  - 9:02:33 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (16318ms)
2025-10-07 09:02:33.271 [info] [Info  - 9:02:33 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (16318ms)
2025-10-07 09:02:50.942 [info] [Warn  - 9:02:50 AM] (3830753) BG: Workspace indexing has hit its upper limit: 2000 files
2025-10-07 09:50:38.719 [info] [Info  - 9:50:38 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (16373ms)
2025-10-07 09:50:38.733 [info] [Info  - 9:50:38 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (16431ms)
2025-10-07 11:01:36.778 [info] [Info  - 11:01:36 AM] (3830753) Found 42702 source files
2025-10-07 11:01:39.077 [info] [Info  - 11:01:39 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript.py (2090ms)
2025-10-07 11:01:39.077 [info] [Info  - 11:01:39 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript.py (2264ms)
2025-10-07 11:01:57.803 [info] [Info  - 11:01:57 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (17416ms)
2025-10-07 11:01:57.819 [info] [Info  - 11:01:57 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (17461ms)
2025-10-07 11:01:59.596 [info] [Info  - 11:01:59 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (19315ms)
2025-10-07 11:01:59.596 [info] [Info  - 11:01:59 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (19315ms)
2025-10-07 11:02:27.503 [info] [Warn  - 11:02:27 AM] (3830753) BG: Workspace indexing has hit its upper limit: 2000 files
2025-10-07 11:03:02.520 [info] [Info  - 11:03:02 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (20706ms)
2025-10-07 11:03:02.532 [info] [Info  - 11:03:02 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (20769ms)
2025-10-07 11:04:39.393 [info] [Info  - 11:04:39 AM] (3830753) Found 43232 source files
2025-10-07 11:04:43.699 [info] [Info  - 11:04:43 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript.py (3768ms)
2025-10-07 11:04:43.699 [info] [Info  - 11:04:43 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/notebooks_scripts/test_transcript.py (4230ms)
2025-10-07 11:05:02.287 [info] [Info  - 11:05:02 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (17172ms)
2025-10-07 11:05:02.287 [info] [Info  - 11:05:02 AM] (3830753) BG: [BG(1)] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (17228ms)
2025-10-07 11:05:03.275 [info] [Info  - 11:05:03 AM] (3830753) BG: [BG(1)] Long operation: checking: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (18313ms)
2025-10-07 11:05:03.275 [info] [Info  - 11:05:03 AM] (3830753) BG: [BG(1)] Long operation: analyzing: file:///home/idaia/appli/data/users/f838079/git/plume2/src/plume2/core/transciption.py (18315ms)
2025-10-07 11:05:23.672 [info] [Warn  - 11:05:23 AM] (3830753) BG: Workspace indexing has hit its upper limit: 2000 files
2025-10-07 11:07:24.150 [info] [Info  - 11:07:24 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py (19621ms)
2025-10-07 11:07:24.164 [info] [Info  - 11:07:24 AM] (3830753) [FG] Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/__init__.py (19713ms)
2025-10-07 11:09:50.817 [info] [Info  - 11:09:50 AM] (3830753) virtual workspace: vscode-chat-code-block://ff677914-0a74-44a1-816e-8296e9958f7f/
2025-10-07 11:09:50.817 [info] [Info  - 11:09:50 AM] (3830753) Starting service instance "<default>" for workspace "vscode-chat-code-block://ff677914-0a74-44a1-816e-8296e9958f7f/"
2025-10-07 11:09:50.904 [info] [Info  - 11:09:50 AM] (3830753) Setting environmentName for service "<default>": "3.13.5 (plume2 venv)"
2025-10-07 11:09:50.905 [info] [Info  - 11:09:50 AM] (3830753) No include entries specified; assuming vscode-chat-code-block://ff677914-0a74-44a1-816e-8296e9958f7f/
2025-10-07 11:09:50.968 [info] [Info  - 11:09:50 AM] (3830753) Assuming Python version 3.11.7.final.0
2025-10-07 11:09:51.179 [info] [Error - 11:09:51 AM] (3830753) File or directory "vscode-chat-code-block://ff677914-0a74-44a1-816e-8296e9958f7f/" does not exist.
2025-10-07 11:09:51.180 [info] [Info  - 11:09:51 AM] (3830753) No source files found.

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i5-1335U (12 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.64GB (3.04GB free)
Process Argv --crash-reporter-id 85fe520f-7087-4ac6-a932-bdefaa21f931
Screen Reader no
VM 0%
Item Value
Remote SSH: HPC
OS Linux x64 4.18.0-553.33.1.el8_10.x86_64
CPUs Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz (48 x 0)
Memory (System) 2015.53GB (1658.36GB free)
VM 0%
Item Value
Remote SSH: HPC
OS Linux x64 4.18.0-553.33.1.el8_10.x86_64
CPUs Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz (48 x 0)
Memory (System) 2015.53GB (1658.36GB free)
VM 0%
Item Value
Remote SSH: HPC
OS Linux x64 4.18.0-553.33.1.el8_10.x86_64
CPUs Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz (48 x 0)
Memory (System) 2015.53GB (1658.36GB free)
VM 0%
Item Value
Remote SSH: HPC
OS Linux x64 4.18.0-553.33.1.el8_10.x86_64
CPUs Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz (48 x 0)
Memory (System) 2015.53GB (1658.36GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
vscrp:30673768
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
pythonrdcb7:31342333
usemplatestapi:31297334
aj953862:31281341
6abeh943:31336334
gendocstringf:31395206
asdad:31365766
cloudbuttont:31379625
3efgi100_wstrepl:31382709
86221569:31396837

Guillaume-Lombardo avatar Oct 07 '25 09:10 Guillaume-Lombardo

Hi @Guillaume-Lombardo, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.


Potential Duplicate IssuesThese issues may be duplicates of your report, but may differ in some of the details.

  • Pylance becomes increasingly slow and unresponsive over time – performance degradation and high CPU usage after extended use. https://github.com/microsoft/pylance-release/issues/3514
  • Massive performance issues for all Pylance features in some projects – slow completions, hovers, go-to-definition in larger repos. https://github.com/microsoft/pylance-release/issues/3632
  • Painfully slow autocomplete suggestions if you type fast – lag between keystroke and autocomplete popup, possible overload. https://github.com/microsoft/pylance-release/issues/5297

The team will respond to your issue shortly. Please note this is a trial feature and may not be fully accurate. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or was incorrect, please give it a 👎. Your feedback helps us improve!

github-actions[bot] avatar Oct 07 '25 09:10 github-actions[bot]

Hi there. Is this a public repo?

First I'd try updating Pylance from 2025.4.1 to latest. then I'd remove any excludes you have set in settings. try again. note we auto exclude the .venv folder.. if you manually add excludes you should exclude your vevn folder too.

can you share your pyproject.toml

bschnurr avatar Oct 07 '25 16:10 bschnurr

This file in particular sounds like it might part of the problem:

Long operation: binding: file:///home/idaia/appli/data/users/f838079/git/plume2/.venv/lib/python3.13/site-packages/transformers/models/__init__.py

I can reproduce the problem with this code:

from transformers import pipeline

pipeline = pipeline(task="text-generation", model="Qwen/Qwen2.5-1.5B")
pipeline("the secret to baking a really good cake is ")
[{'generated_text': 'the secret to baking a really good cake is 1) to use the right ingredients and 2) to follow the recipe exactly. the recipe for the cake is as follows: 1 cup of sugar, 1 cup of flour, 1 cup of milk, 1 cup of butter, 1 cup of eggs, 1 cup of chocolate chips. if you want to make 2 cakes, how much sugar do you need? To make 2 cakes, you will need 2 cups of sugar.'}]

For me it takes 10 seconds to analyze that code above.

rchiodo avatar Oct 07 '25 16:10 rchiodo

We think it's code like this in the transformers\models\__init__.py

if TYPE_CHECKING:
    from .aimv2 import *
    from .albert import *
    from .align import *
    from .altclip import *
    from .arcee import *
    from .aria import *
    from .audio_spectrogram_transformer import *
    from .auto import *
    from .autoformer import *
    from .aya_vision import *
    from .bamba import *
    from .bark import *
    from .bart import *
    from .barthez import *
    from .bartpho import *
    from .beit import *
    from .bert import *
    from .bert_generation import *
    from .bert_japanese import *
    from .bertweet import *
    from .big_bird import *
    from .bigbird_pegasus import *
    from .biogpt import *
    from .bit import *
    from .bitnet import *
    from .blenderbot import *
    from .blenderbot_small import *
    from .blip import *
    from .blip_2 import *
    from .bloom import *
    from .blt import *
    from .bridgetower import *
    from .bros import *
    from .byt5 import *
    ...

You might want to log a bug on the transformers package saying they don't need to import the world when type checking. That's what is taking so long.

rchiodo avatar Oct 07 '25 16:10 rchiodo

as a temp work around..

  1. delete py.typed file in transformers folder
  2. add # pyright: reportMissingTypeStubs=true to your code that imports pipeline
  3. you should see a code action "Create Type Stub For "transformers"
Image

this will create a new "typings" folder in your workspace, with new typestubs.. note they aren't perfect.

mine times went from 11 seconds to 3.5 seconds

bschnurr avatar Oct 07 '25 16:10 bschnurr

this was the commit. https://github.com/huggingface/transformers/commit/54a123f068c57abe8bc27a507d05d5674f5862bf#diff-9c1b14b0c0dfe8b9f0c362c933510196389134dbf3ccd9075fb3437ba8933482

bschnurr avatar Oct 07 '25 17:10 bschnurr

As a Python core developer and the implementor of Python's import system, I would say the way transformers is doing it is ill-advised.

First, * imports are only meant as a shortcut in the REPL, not for general usage. You should just import to the module or the objects in the module to be clear about where something comes from.

Second, having all of those imports be in an if TYPE_CHECKING block means that they are only available to type checkers. That would suggest that if they are grabbing classes and such via transformers.models just for type annotations then you now have differing imports from where the actual code gets it from, creating a disparity. And if the imports really are just for that file, then we are back at my first point that you should be explicit about what you want from those modules instead of a blanket "everything" with *.

brettcannon avatar Oct 07 '25 18:10 brettcannon

that * under the type checking in the transformer package, actually bring in about 38K files transitively through nested * imports. pylance does it lazily (meaning we only bring them in when they are needed), but to generate errors or completion/hover and etc, we need to know all symbols available, and * basically telling pylance that all symbols in these 38K files are available from this __init__ module.

so, we need to bring them in, but we only need to do it once. so it should be one time cost.

heejaechang avatar Oct 07 '25 18:10 heejaechang

thank you for your help. I now have a better understanding of the root cause.

Unfortunately, it's for a private repo and I can't share it.

here is my pyproject if still needed:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "plume2"
version = "0.1.0"
authors = [
    { name = "Guillaume Lombardo", email = "guillaume.lombardo@**********" },
]
description = "Une reécriture du package s2t. Le but est de faire des transcription avec diarization d'audio. Il utilise pyannote et whisper."
requires-python = ">=3.13"
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }

[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
addopts = "--cov-report html --cov=src/"
pythonpath = ["src"]
asyncio_default_fixture_loop_scope = "session"

[tool.coverage.run]
omit = ["tests/*", "documentation/*"]

[tool.coverage.report]
exclude_lines = [
    # Don't complain about missing debug-only code:
    "def __repr__",
    "if self\\.debug",

    # Don't complain if tests don't hit defensive assertion code:
    "raise AssertionError",
    "raise NotImplementedError",

    # Don't complain if non-runnable code isn't run:
    "if 0:",
    "if __name__ == .__main__.:",

    # Don't complain about abstract methods and protocols, they aren't run:
    "@(abc\\.)?abstractmethod",
    "class [^(]+\\(Protocol\\):",
]

[tool.coverage.html]
directory = "cov_html"

[tool.setuptools.package-data]
plume2 = ["ressources/*"]

[project.scripts]
plume2-coverage = "plume2.launcher:run_cov"

I'll try to add a pyright section like so:

[tool.pyright]
pythonVersion = "3.13"
include = ["src", "tests"]
venvPath = "."
venv = ".venv"
typeCheckingMode = "standard"
executionEnvironments = [
  { root = "src", extraPaths = ["src"] }

Guillaume-Lombardo avatar Oct 08 '25 07:10 Guillaume-Lombardo