Skip to content

pyright strict mode raises diagnostics caused by arcade's code, not consumer code #1394

@cspotcode

Description

@cspotcode

Bug Report

Related to #1390

When running pyright with typeCheckingMode: strict, you get diagnostics caused by arcade's code, not the consumer's code. This requires consumers to disable certain pyright typechecking rules, which prevents consumers from leveraging those rules for their own code.

This is a broad request. Different diagnostics can be avoided in different ways, and with different levels of effort. I felt it appropriate to open a single issue to start, but this could be split into different issues, each describing a different kind of diagnostic and the changes necessary to fix it.

The example below demonstrates a reportPrivateImportUsage diagnostic.

System Info

Arcade 2.6.16
-------------
vendor: Intel
renderer: Intel(R) Iris(R) Xe Graphics
version: (4, 6)
python: 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
platform: win32

Actual behavior:

Code that consumes the arcade API can be typechecked with pyright's commonly-used "strict" option.

pyrightconfig.json:

{
    "include": ["src"],
    "typeCheckingMode": "strict"

example.py

import arcade
arcade.color.AERO_BLUE # <-- raises diagnostic: error: "color" is not exported from module "arcade" (reportPrivateImportUsage)

Expected behavior:

The code above should not raise a diagnostic.

Steps to reproduce/example code:

Use the pyrightconfig.json and example.py above, pip install pyright && python -m pyright

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions