Skip to content

Add back support for warn_unused_configs#20801

Merged
ilevkivskyi merged 2 commits intopython:masterfrom
ilevkivskyi:enable-unused-configs
Feb 17, 2026
Merged

Add back support for warn_unused_configs#20801
ilevkivskyi merged 2 commits intopython:masterfrom
ilevkivskyi:enable-unused-configs

Conversation

@ilevkivskyi
Copy link
Member

Fixes #7998

This was disabled in incremental mode (i.e. almost always, since this is now the default), because we didn't clone options for suppressed dependencies, but now because we are doing this (for the purpose of fixing other issues), there is no reason to keep this disabled (IMO this is a nice feature to keep your config clean).

Few more things here:

  • I moved the logic inside build.build(), first it is wrong to show this warning in case of blocking errors (since we may not processed all files yet), second it is easier to test.
  • I am now using more standard message formatting path: note: ...
  • I am updating couple comments I forgot to update in previous PRs (sorry)

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

psycopg (https://github.com/psycopg/psycopg)
- Warning: unused section(s) in pyproject.toml: module = ['polib', 'scrap.*']
+ pyproject.toml: note: unused section(s): module = ['polib', 'scrap.*']

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- Warning: unused section(s) in pyproject.toml: module = ['test.*']
+ pyproject.toml: note: unused section(s): module = ['test.*']

cibuildwheel (https://github.com/pypa/cibuildwheel)
- Warning: unused section(s) in pyproject.toml: module = ['importlib_resources', 'setuptools._distutils', 'setuptools._distutils.util']
+ pyproject.toml: note: unused section(s): module = ['importlib_resources', 'setuptools._distutils', 'setuptools._distutils.util']

core (https://github.com/home-assistant/core)
- Warning: unused section(s) in mypy.ini: [mypy-tests.*]
+ mypy.ini: note: unused section(s): [mypy-tests.*]

more-itertools (https://github.com/more-itertools/more-itertools)
- Warning: unused section(s) in setup.cfg: [mypy-tests.*]
+ setup.cfg: note: unused section(s): [mypy-tests.*]

sphinx (https://github.com/sphinx-doc/sphinx)
- Warning: unused section(s) in pyproject.toml: module = ['pyximport', 'tests.test_config.test_config', 'tests.test_directives.test_directive_other', 'tests.test_domains.test_domain_c', 'tests.test_domains.test_domain_cpp', 'tests.test_domains.test_domain_js', 'tests.test_domains.test_domain_py', 'tests.test_domains.test_domain_py_fields', 'tests.test_domains.test_domain_py_pyfunction', 'tests.test_domains.test_domain_py_pyobject', 'tests.test_domains.test_domain_std', 'tests.test_environment.test_environment_toctree', 'tests.test_ext_autodoc.test_ext_autodoc', 'tests.test_ext_autodoc.test_ext_autodoc_mock', 'tests.test_ext_autosummary.test_ext_autosummary', 'tests.test_ext_intersphinx.test_ext_intersphinx', 'tests.test_ext_napoleon.test_ext_napoleon_docstring', 'tests.test_extensions.test_ext_apidoc', 'tests.test_extensions.test_ext_inheritance_diagram', 'tests.test_search', 'tests.test_util.test_util_inspect', 'tests.test_util.test_util_nodes', 'tests.test_util.test_util_typing', 'tests.test_util.typing_test_data']
+ pyproject.toml: note: unused section(s): module = ['pyximport', 'tests.test_config.test_config', 'tests.test_directives.test_directive_other', 'tests.test_domains.test_domain_c', 'tests.test_domains.test_domain_cpp', 'tests.test_domains.test_domain_js', 'tests.test_domains.test_domain_py', 'tests.test_domains.test_domain_py_fields', 'tests.test_domains.test_domain_py_pyfunction', 'tests.test_domains.test_domain_py_pyobject', 'tests.test_domains.test_domain_std', 'tests.test_environment.test_environment_toctree', 'tests.test_ext_autodoc.test_ext_autodoc', 'tests.test_ext_autodoc.test_ext_autodoc_mock', 'tests.test_ext_autosummary.test_ext_autosummary', 'tests.test_ext_intersphinx.test_ext_intersphinx', 'tests.test_ext_napoleon.test_ext_napoleon_docstring', 'tests.test_extensions.test_ext_apidoc', 'tests.test_extensions.test_ext_inheritance_diagram', 'tests.test_search', 'tests.test_util.test_util_inspect', 'tests.test_util.test_util_nodes', 'tests.test_util.test_util_typing', 'tests.test_util.typing_test_data']

sympy (https://github.com/sympy/sympy)
- Warning: unused section(s) in pyproject.toml: module = ['gmpy.*', 'pydy.*', 'python-sat.*']
+ pyproject.toml: note: unused section(s): module = ['gmpy.*', 'pydy.*', 'python-sat.*']

svcs (https://github.com/hynek/svcs)
- Warning: unused section(s) in pyproject.toml: module = ['conftest', 'health_check_pyramid', 'pytest.*']
+ pyproject.toml: note: unused section(s): module = ['conftest', 'health_check_pyramid', 'pytest.*']

downforeveryone (https://github.com/rpdelaney/downforeveryone)
- Warning: unused section(s) in pyproject.toml: module = ['.venv.*']
+ pyproject.toml: note: unused section(s): module = ['.venv.*']

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- Warning: unused section(s) in mypy.ini: [mypy-tests.profiling.collector.pprof_3_pb2], [mypy-tests.profiling.collector.pprof_312_pb2], [mypy-tests.profiling.collector.pprof_319_pb2], [mypy-tests.profiling.collector.pprof_421_pb2]
+ mypy.ini: note: unused section(s): [mypy-tests.profiling.collector.pprof_3_pb2], [mypy-tests.profiling.collector.pprof_312_pb2], [mypy-tests.profiling.collector.pprof_319_pb2], [mypy-tests.profiling.collector.pprof_421_pb2]

pylint (https://github.com/pycqa/pylint)
- Warning: unused section(s) in pyproject.toml: module = ['colorama', 'contributors_txt', 'coverage', 'git.*', 'mccabe', 'pytest_benchmark.*', 'sphinx.*']
+ pyproject.toml: note: unused section(s): module = ['colorama', 'contributors_txt', 'coverage', 'git.*', 'mccabe', 'pytest_benchmark.*', 'sphinx.*']

dulwich (https://github.com/dulwich/dulwich)
- Warning: unused section(s) in pyproject.toml: module = ['atheris', 'fastimport.*']
+ pyproject.toml: note: unused section(s): module = ['atheris', 'fastimport.*']

black (https://github.com/psf/black)
- Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
+ pyproject.toml: note: unused section(s): module = ['tests.data.*']

pyodide (https://github.com/pyodide/pyodide)
- Warning: unused section(s) in pyproject.toml: module = ['PIL.*', 'docutils.parsers.rst', 'loky', 'matplotlib.*', 'pytest_pyodide', 'pytest_pyodide.runner', 'pytest_pyodide.utils', 'termcolor', 'test', 'tomli']
+ pyproject.toml: note: unused section(s): module = ['PIL.*', 'docutils.parsers.rst', 'loky', 'matplotlib.*', 'pytest_pyodide', 'pytest_pyodide.runner', 'pytest_pyodide.utils', 'termcolor', 'test', 'tomli']

packaging (https://github.com/pypa/packaging)
- Warning: unused section(s) in pyproject.toml: module = ['pkg_resources', 'pretend', 'progress.*']
+ pyproject.toml: note: unused section(s): module = ['pkg_resources', 'pretend', 'progress.*']

rotki (https://github.com/rotki/rotki)
- Warning: unused section(s) in pyproject.toml: module = ['rotkehlchen.tests.api.test_aave', 'rotkehlchen.tests.api.test_balancer', 'rotkehlchen.tests.api.test_compound', 'rotkehlchen.tests.api.test_defi', 'rotkehlchen.tests.api.test_pickle', 'rotkehlchen.tests.api.test_trades', 'rotkehlchen.tests.api.test_yearn_vaults']
+ pyproject.toml: note: unused section(s): module = ['rotkehlchen.tests.api.test_aave', 'rotkehlchen.tests.api.test_balancer', 'rotkehlchen.tests.api.test_compound', 'rotkehlchen.tests.api.test_defi', 'rotkehlchen.tests.api.test_pickle', 'rotkehlchen.tests.api.test_trades', 'rotkehlchen.tests.api.test_yearn_vaults']

static-frame (https://github.com/static-frame/static-frame)
- Warning: unused section(s) in pyproject.toml: module = ['arraymap', 'doc.*', 'setuptools', 'sphinx.*', 'sphinx_rtd_theme', 'tables']
+ pyproject.toml: note: unused section(s): module = ['arraymap', 'doc.*', 'setuptools', 'sphinx.*', 'sphinx_rtd_theme', 'tables']

artigraph (https://github.com/artigraph/artigraph)
- Warning: unused section(s) in pyproject.toml: module = ['sh']
+ pyproject.toml: note: unused section(s): module = ['sh']

xarray (https://github.com/pydata/xarray)
- Warning: unused section(s) in pyproject.toml: module = ['affine.*', 'cloudpickle.*', 'netcdftime.*', 'setuptools']
+ pyproject.toml: note: unused section(s): module = ['affine.*', 'cloudpickle.*', 'netcdftime.*', 'setuptools']

bokeh (https://github.com/bokeh/bokeh)
- Warning: unused section(s) in pyproject.toml: module = ['tests.*', 'tests.codebase.*', 'tests.support.defaults', 'tests.test_bokehjs', 'tests.test_cross', 'tests.test_defaults', 'tests.test_examples', 'tests.unit.bokeh.document.test_callbacks__document', 'tests.unit.bokeh.embed.test_standalone', 'tests.unit.bokeh.test_layouts__typing', 'tests.unit.bokeh.test_typing']
+ pyproject.toml: note: unused section(s): module = ['tests.*', 'tests.codebase.*', 'tests.support.defaults', 'tests.test_bokehjs', 'tests.test_cross', 'tests.test_defaults', 'tests.test_examples', 'tests.unit.bokeh.document.test_callbacks__document', 'tests.unit.bokeh.embed.test_standalone', 'tests.unit.bokeh.test_layouts__typing', 'tests.unit.bokeh.test_typing']

boostedblob (https://github.com/hauntsaninja/boostedblob)
- Warning: unused section(s) in pyproject.toml: module = ['tests.*', 'xmltodict.*']
+ pyproject.toml: note: unused section(s): module = ['tests.*', 'xmltodict.*']

twine (https://github.com/pypa/twine)
- Warning: unused section(s) in mypy.ini: [mypy-tests.*]
+ mypy.ini: note: unused section(s): [mypy-tests.*]

isort (https://github.com/pycqa/isort)
- Warning: unused section(s) in pyproject.toml: module = ['importlib_metadata.*', 'tests.*']
+ pyproject.toml: note: unused section(s): module = ['importlib_metadata.*', 'tests.*']

nox (https://github.com/wntrblm/nox)
- Warning: unused section(s) in pyproject.toml: module = ['tox.*']
+ pyproject.toml: note: unused section(s): module = ['tox.*']

@ilevkivskyi
Copy link
Member Author

If there are no objections here, I will be merging this later today.

@ilevkivskyi ilevkivskyi merged commit d3de4a4 into python:master Feb 17, 2026
25 checks passed
@ilevkivskyi ilevkivskyi deleted the enable-unused-configs branch February 17, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support warn_unused_configs in incremental mode

2 participants