What's wrong
If you add to __init__.py docstring and re-export, then the error WPS412 Found appears__init__.py `module with logic', which contradicts the documentation.
How to reproduce:
Make a project structure like this
├── package
│ ├── __init__.py
│ └── module.py
└──setup.cfg
Place in package/__init__.py some code
"""
Docstring for package.
"""
from package.module import make_foo as make_foo
For example, i put into package/module.py this code:
def make_foo():
"""foo func."""
setup.cfg
[flake8]
# flake8 configuration:
# https://flake8.pycqa.org/en/latest/user/configuration.html
# We use `flake8` together with `ruff`, so we only select rules that
# are not ported to `ruff`.
format = wemake
show-source = true
statistics = false
doctests = true
# Flake plugins:
max-line-length = 80
max-complexity = 6
max-imports = 20
max-name-length = 50
extend-exclude =
venv,
# Only select errors that are not covered by `ruff`:
select = WPS, E99
How it should be
There should be no WPS412 violation triggered.
Flake8 version and plugins
{
"platform": {
"python_implementation": "CPython",
"python_version": "3.13.2",
"system": "Darwin"
},
"plugins": [
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pycodestyle",
"version": "2.14.0"
},
{
"plugin": "pyflakes",
"version": "3.4.0"
},
{
"plugin": "wemake-python-styleguide",
"version": "1.4.0"
}
],
"version": "7.3.0"
}
pip information
pip 25.0 from /Users/milssky/dev/python/flaky_jobs/venv/lib/python3.13/site-packages/pip (python 3.13)
attrs==25.4.0
flake8==7.3.0
mccabe==0.7.0
pycodestyle==2.14.0
pyflakes==3.4.0
Pygments==2.19.2
wemake-python-styleguide==1.4.0
OS information
macOS Tahoe 26.1, apple m3
What's wrong
If you add to
__init__.pydocstring and re-export, then the errorWPS412 Foundappears__init__.py `module with logic', which contradicts the documentation.How to reproduce:
Make a project structure like this
Place in
package/__init__.pysome codeFor example, i put into
package/module.pythis code:setup.cfg
How it should be
There should be no WPS412 violation triggered.
Flake8 version and plugins
pip information
OS information
macOS Tahoe 26.1, apple m3