Skip to content

Openpyxl literals like "BORDER_MEDIUM" throw "is unknown import symbol (reportGeneralTypeIssues)" #1432

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

Closed
chakflying opened this issue Jun 11, 2021 · 3 comments
Labels
typestub Issue relating to our bundled type stubs waiting for upstream Waiting for upstream to release a fix

Comments

@chakflying
Copy link

When borders are imported in a file, they would show error, but they are clearly defined in the openpyxl file.

The type annotation of the openpyxl file, shown in VSCode:

(constant) BORDER_MEDIUM: Literal['medium']

The actual code runs without issues.

Environment data

  • Language Server version: 2021.6.1
  • OS and version: Windows 10 20H2
  • Python version: Python 3.8.9 64-bit, virtual environment created by pipenv
  • openpyxl 3.0.7

Expected behaviour

No error should be shown

Actual behaviour

"BORDER_MEDIUM" is unknown import symbol Pylance(reportGeneralTypeIssues)

Logs

[Info  - 11:54:17 am] Pylance language server 2021.6.1 (pyright e3f7cccc) starting
[Info  - 11:54:17 am] Server root directory: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist
[Info  - 11:54:17 am] No configuration file found.
[Info  - 11:54:17 am] No pyproject.toml file found.
[Info  - 11:54:17 am] Setting pythonPath for service "my-project": "C:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Scripts\python.exe"
[Warn  - 11:54:17 am] stubPath c:\Dev\...\my-project\typings is not a valid directory.
[Info  - 11:54:17 am] Assuming Python version 3.8
[Info  - 11:54:17 am] Assuming Python platform Windows
Search paths for c:\Dev\...\my-project
  c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib
  c:\Dev\...\my-project
  c:\Dev\...\my-project\typings
  c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stubs\...
  c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs
  c:\python38\python38.zip
  c:\Python38\DLLs
  c:\Python38\Lib
  c:\Python38
  c:\Users\...\.virtualenvs\my-project-z6Bg9U_b
  c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages
[Info  - 11:54:20 am] Searching for source files
[Info  - 11:54:20 am] Found 11 source files
[Info  - 11:54:20 am] Background analysis(1) root directory: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist
[Info  - 11:54:20 am] Background analysis(1) started
Background analysis message: setConfigOptions
Background analysis message: ensurePartialStubPackages
Background analysis message: setTrackedFiles
Background analysis message: markAllFilesDirty
Background analysis message: setFileOpened
IntelliCode model c:\Users\...\.vscode\extensions\visualstudioexptteam.vscodeintellicode-1.2.14\cache\E61945A9A512ED5E1A3EE3F1A2365B88F8FE_E4E9EADA96734F01970E616FAB2FAC19
Background analysis message: getSemanticTokens full
[BG(1)] getSemanticTokens full at c:\Dev\...\my-project\emfac_writer.py ...
[BG(1)]   parsing: c:\Dev\...\my-project\emfac_writer.py (85ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\builtins.pyi [fs read 1ms] (76ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\builtins.pyi (34ms)
[BG(1)]   binding: c:\Dev\...\my-project\emfac_writer.py (5ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing.pyi [fs read 2ms] (34ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing.pyi (9ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_typeshed\__init__.pyi [fs read 3ms] (6ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_typeshed\__init__.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing_extensions.pyi [fs read 1ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing_extensions.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\logging\__init__.pyi [fs read 3ms] (13ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\logging\__init__.pyi (3ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\os\__init__.pyi [fs read 2ms] (26ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\os\__init__.pyi (8ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\copy.pyi [fs read 0ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\copy.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\dataclasses.pyi [fs read 0ms] (5ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\dataclasses.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\__init__.pyi [fs read 0ms] (15ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\__init__.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\reader\excel.pyi [fs read 2ms] (5ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\reader\excel.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\io.pyi [fs read 1ms] (4ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\io.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\abc.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\abc.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\workbook\workbook.pyi [fs read 3ms] (7ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\workbook\workbook.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\borders.pyi [fs read 2ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\borders.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\numbers.pyi [fs read 0ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\numbers.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\utils\__init__.pyi [fs read 2ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\utils\__init__.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\utils\cell.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\utils\cell.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\__init__.py [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\__init__.py (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\std.py [fs read 1ms] (64ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\std.py (15ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\utils.py [fs read 1ms] (19ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\utils.py (3ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\threading.pyi [fs read 0ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\threading.pyi (2ms)
[BG(1)]   parsing: c:\Dev\...\my-project\globals.py [fs read 0ms] (10ms)
[BG(1)]   binding: c:\Dev\...\my-project\globals.py (3ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\colors.pyi [fs read 0ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\colors.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\__init__.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\__init__.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\alignment.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\alignment.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\fonts.pyi [fs read 0ms] (7ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\fonts.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\coloredlogs\__init__.py [fs read 1ms] (39ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\coloredlogs\__init__.py (5ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\compat.py [fs read 1ms] (8ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\compat.py (1ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\terminal\__init__.py [fs read 0ms] (18ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\terminal\__init__.py (3ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\decorators.py [fs read 0ms] (0ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\decorators.py (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\re.pyi [fs read 0ms] (2ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\re.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\enum.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\enum.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\functools.pyi [fs read 1ms] (6ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\functools.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\platform.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\platform.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\sys.pyi [fs read 0ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\sys.pyi (6ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\ctypes\__init__.pyi [fs read 3ms] (8ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\ctypes\__init__.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stubs\colorama\colorama\__init__.pyi [fs read 3ms] (4ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stubs\colorama\colorama\__init__.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\coloredlogs\syslog.py [fs read 0ms] (2ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\coloredlogs\syslog.py (3ms)
Loading ONNX runtime...
Loaded ONNX runtime. Creating IntelliCode session...
Created IntelliCode session.
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\__init__.py [fs read 0ms] (6ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\__init__.py (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\logging\handlers.pyi [fs read 0ms] (6ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\logging\handlers.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\text.py [fs read 0ms] (5ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\humanfriendly\text.py (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\worksheet\worksheet.pyi [fs read 3ms] (19ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\worksheet\worksheet.pyi (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\workbook\child.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\workbook\child.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\cell\cell.pyi [fs read 2ms] (8ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\cell\cell.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\styleable.pyi [fs read 1ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\styleable.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\cell\read_only.py [fs read 2ms] (7ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\cell\read_only.py (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\datetime.pyi [fs read 0ms] (4ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\datetime.pyi (5ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\unicodedata.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\unicodedata.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\collections\__init__.pyi [fs read 3ms] (9ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\collections\__init__.pyi ...
[BG(1)]     parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_collections_abc.pyi [fs read 0ms] (0ms)
[BG(1)]     binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_collections_abc.pyi (0ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\collections\__init__.pyi (4ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\_monitor.py [fs read 1ms] (5ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\tqdm\_monitor.py (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\warnings.pyi [fs read 1ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\warnings.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_warnings.pyi [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_warnings.pyi (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\chartsheet\chartsheet.py [fs read 2ms] (5ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\chartsheet\chartsheet.py (0ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\serialisable.py [fs read 1ms] (4ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\serialisable.py (2ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\__init__.py [fs read 0ms] (1ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\__init__.py ...
[BG(1)]     parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\base.py [fs read 0ms] (3ms)
[BG(1)]     binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\base.py (3ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\descriptors\__init__.py (7ms)
[BG(1)]   parsing: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\worksheet\_read_only.py [fs read 2ms] (4ms)
[BG(1)]   binding: c:\Users\...\.virtualenvs\my-project-z6Bg9U_b\Lib\site-packages\openpyxl\worksheet\_read_only.py (1ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\types.pyi [fs read 1ms] (3ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\types.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\os\path.pyi [fs read 1ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\os\path.pyi ...
[BG(1)]     parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\ntpath.pyi [fs read 1ms] (1ms)
[BG(1)]     binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\ntpath.pyi (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\os\path.pyi (2ms)
[BG(1)]   parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\genericpath.pyi [fs read 1ms] (1ms)
[BG(1)]   binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\genericpath.pyi (0ms)
[BG(1)] getSemanticTokens full at c:\Dev\...\my-project\emfac_writer.py (1087ms)
Background analysis message: getSemanticTokens range
[BG(1)] getSemanticTokens range 0:0 - 72:42 at c:\Dev\...\my-project\emfac_writer.py (15ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getSemanticTokens range
[BG(1)] getSemanticTokens range 0:0 - 71:17 at c:\Dev\...\my-project\emfac_writer.py (14ms)
Background analysis message: analyze
[BG(1)] analyzing: c:\Dev\...\my-project\emfac_writer.py ...
[BG(1)]   checking: c:\Dev\...\my-project\emfac_writer.py (30ms)
[BG(1)] analyzing: c:\Dev\...\my-project\emfac_writer.py (30ms)
Background analysis message: getDiagnosticsForRange
[FG] parsing: c:\Dev\...\my-project\emfac_writer.py (68ms)
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\builtins.pyi [fs read 3ms] (70ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\builtins.pyi (32ms)
[FG] binding: c:\Dev\...\my-project\emfac_writer.py (4ms)
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\numbers.pyi [fs read 1ms] (18ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\numbers.pyi (1ms)
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing.pyi [fs read 1ms] (28ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing.pyi (13ms)
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\borders.pyi [fs read 2ms] (5ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\bundled\stubs\openpyxl\styles\borders.pyi (0ms)
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_typeshed\__init__.pyi [fs read 0ms] (3ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\_typeshed\__init__.pyi (1ms)
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing_extensions.pyi [fs read 0ms] (3ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\typing_extensions.pyi (1ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\abc.pyi [fs read 0ms] (0ms)
[FG] binding: c:\Users\...\.vscode\extensions\ms-python.vscode-pylance-2021.6.1\dist\typeshed-fallback\stdlib\abc.pyi (0ms)

Code Snippet / Additional information

Import Statement:

from openpyxl.styles.borders import BORDER_MEDIUM, Side

Inside openpyxl/styles/borders.py:

BORDER_DOUBLE = 'double'
BORDER_HAIR = 'hair'
BORDER_MEDIUM = 'medium'
BORDER_MEDIUMDASHDOT = 'mediumDashDot'
BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'

VSCode config:
"python.analysis.typeCheckingMode": "basic"

@MapleCCC
Copy link

MapleCCC commented Jun 13, 2021

From the log you presented, it seems the problem originates from that Pylance defaults to use type information from the bundled type stub for the openpyxl library, which doesn't contain annotations for symbolic constants like BORDER_MEDIUM.

The upstream repository for Pylance's bundled type stub of openpyxl is MartinThoma/openpyxl-stubs. I opened a PR there to fix the problem.

@judej judej added typestub Issue relating to our bundled type stubs waiting for upstream Waiting for upstream to release a fix labels Jun 14, 2021
@github-actions github-actions bot removed the triage label Jun 14, 2021
@MapleCCC
Copy link

The latest Pylance release 2021.6.3 (23 June 2021) has updated the bundled stub for openpyxl. The problem should have been fixed by now. You may consider having a try and closing the issue if nothing went wrong.

@jakebailey
Copy link
Member

Oops, yes, forgot to mark this as fixed when I updated them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typestub Issue relating to our bundled type stubs waiting for upstream Waiting for upstream to release a fix
Projects
None yet
Development

No branches or pull requests

4 participants