Skip to content

Allow re-exports in __init__.py for WPS412 #3486

@Evgenmater

Description

@Evgenmater

Rule request

Thesis

I propose to relax WPS412 to allow __init__.py files to perform re-exports when they only contain import statements and no internal logic.

Example:
from some_project.apps.some_app.infrastructure.repository.example import ExampleRepo as ExampleRepo

Reasoning

  1. It is common Python practice to use __init__.py to expose a package’s public API.
  2. These files do not contain business logic, only import statements for convenience.
  3. The current rule forces per-file-ignores even when no real logic exists.
  4. Such re-exports are idiomatic in larger codebases (e.g., DDD-style architectures).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions