Skip to content

pylance and pylint are unable to resolve package content #79

@mariuswallraff

Description

@mariuswallraff

Describe the bug

VS Code fails to resolve functions imported from simplification (e.g., via from simplification.cutil import simplify_coords_vw_idx), and pylint fails on GitLab's CI/CD with E0611: No name 'simplify_coords_vw_idx' in module 'simplification.cutil' (no-name-in-module) despite all tests passing (i.e., the import works at runtime).

System (please complete the following information)

  • OS: linux (GitLab CI/CD)
  • Architecture: x86_64
  • simplification 0.7.10, python 3.12, pylint 2.17.7

Additional context

I suppose a solution might be to add an __init__.py to the src directory. For Python 3.3+, that's not strictly required due to namespace packages existing, but it seems pylint cannot handle that perfectly yet, nor can VS Code's Pylance.

pylint-dev/pylint#4057

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions