Skip to content

mypy suite is not run with strict mode and many typing errors still remain #1377

Description

@marcinbarczynski

Describe the bug

In a basic checking mode, pyright reports an error when importing a symbol from a module that is not re-exported using import ... as ... convention. In alembic.util package __init__.py imports symbols from other modules within the package.
I assume the intention was to re-export the imported symbols.

Expected behavior

No error reported by pyright.

To Reproduce

from alembic.util import coerce_resource_to_filename

def fun():
    coerce_resource_to_filename("A")

Error

$ pyright ../demo.py 
/path/to/demo.py
  /path/to/demo.py:1:26 - error: "coerce_resource_to_filename" is not exported from module "alembic.util"
    Import from "alembic.util.pyfiles" instead (reportPrivateImportUsage)
1 error, 0 warnings, 0 informations 

Versions.

  • OS: Linux
  • Python: 3.11.5
  • pyright: 1.1.339
  • Alembic: 1.13.0

Have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpep 484typing related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions