Skip to content

Treat global dunder names as always used #387

Open
@anntzer

Description

@anntzer

When using a package versioning helper such as setuptools_scm, it is quite natural to write, in a package's toplevel __init__.py, something like

from ._version import version as __version__

(assuming one uses setuptools_scm's write_to option rather than pkg_resources, as the latter can be quite slow).

Currently, pyflakes complains that __version__ is an unused name. Obviously, one can placate pyflakes by writing (over two lines) from . import _version; __version__ = _version.version, but that seems a bit silly: I would instead suggest that pyflakes consider all global-level dunders as automatically used (in the sense "they have a special or metadata role anyways"), even if they appear not so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions