[diagnostic] Reproduce #9168 cyclic-import macOS gap#11048
Draft
Pierre-Sassoulas wants to merge 5 commits into
Draft
[diagnostic] Reproduce #9168 cyclic-import macOS gap#11048Pierre-Sassoulas wants to merge 5 commits into
Pierre-Sassoulas wants to merge 5 commits into
Conversation
…forms pylint-dev#9168 reports that the same project layout produces R0401 cyclic-import on Linux but not on macOS. This subprocess-based test sets up the reporter's exact directory layout in tmp_path and asserts the warning fires. Purpose: use the macOS CI runner to confirm whether the bug still reproduces on current main. If the assertion fails on macOS only, the platform-dependent behavior is confirmed; if both platforms pass, the bug has been silently fixed. Not intended for merge as-is.
for more information, see https://pre-commit.ci
…pand_modules unittest_expand_modules.py parametrizes against a fixed list of files in tests/lint/. Putting a new file in that directory failed all CI jobs.
… reproduce For each issue, build the reporter's minimal repro in tmp_path and assert that the originally-reported false positive or crash signature is absent. If CI is green on all platforms, the bugs are silently fixed since the issue was filed and can be closed. - pylint-dev#4899 pydantic field(default_factory=lambda: []) no-member / not-an-iterable - pylint-dev#4917 with-block rebinding no-member - pylint-dev#7268 NamedTuple multi-assignment crash - pylint-dev#8980 azure-monitor namespace package no-name-in-module - pylint-dev#9137 bson LEGACY_JSON_OPTIONS.with_options UninferableBase crash - pylint-dev#9983 Uninferable_factory unexpected-keyword-arg FP
- pylint-dev#4667 (argparse subclass + Py3.9-only no-member): assert FP absent. The bug was Py3.9-only at filing, but Py3.9 is no longer supported, so we cross-check the fix on every supported interpreter. - pylint-dev#6352 (Gtk.Window subclass + self.x assignment → no-member on add/ show_all): assert FP IS present. PyGObject-only; pytest skips elsewhere. When the assertion flips, the bug is fixed. - pylint-dev#7122 (apt_pkg SourceRecords.binaries / Acquire.items not-an-iterable): assert FP IS present. python3-apt only; pytest skips elsewhere. The latter two were originally on my 'cannot reproduce without external env' list. Trying harder with the reporter's full code (not just my distilled minimum) shows both bugs are still real today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Changes
Purpose
Diagnostic only. Do not merge.
Sweeps the
Needs reproduction :mag:backlog: each test recreates a reporter's minimal repro undertmp_path, runs pylint as a subprocess, and asserts whether the originally reported signature is present. CI on Linux / macOS / Windows then tells us, per issue, whether the bug is real today, silently fixed, or platform-specific.#9168 — does the bug still reproduce on macOS?
test_cyclic_import_9168.pybuilds the reporter's layout and assertscyclic-importis emitted. Expected outcomes:regression-tests-fixed-issues.Six "apparently fixed" issues — does the fix hold?
Six tests, one per issue, assert the originally reported signature is absent:
no-member/not-an-iterablepydantic.dataclasses+field(default_factory=lambda: [])no-memberwith CtxMgr() as x:blockclass Color(NamedTuple): A, B = 1, 2(tuple-unpacked attrs)no-name-in-moduleazure.monitor.opentelemetry.exporterimportsUninferableBasecrashLEGACY_JSON_OPTIONS.with_options(...)frombson.json_utilunexpected-keyword-arg(syntheticUninferable_factory)Registry(**{f"{name}_factory": ...})All-green on a platform means the bug is fixed there. Ask the reporter to confirm on a current release, close, and promote the test.
#4667 — cross-check the Py3.9-only argparse FP
argparse.ArgumentParsersubclass once trippedno-memberonNamespaceattribute access (Py3.9-only at filing). Pylint no longer supports 3.9, buttest_argparse_subclass_4667.pyexercises the same shape on every supported interpreter to confirm the FP doesn't sneak back in elsewhere.Two "still-real" bugs surfaced by trying the full user repro
My first attempt at a minimal repro for these two missed the trigger. Re-running with the reporter's full code reproduces the bug today on Linux. Both tests assert the FP is present (an inverted diagnostic) so that when CI flips green the bug is gone.
no-memberonGtk.Windowinherited methodsGtk.Windowsubclass also sets an instance attribute onselfnot-an-iterableonapt_pkgSourceRecords.binaries/Acquire.itemsapt.progress.text.AcquireProgress()+apt.Cache(rootdir=...)Library-dependent tests use
pytest.importorskip:pydantic/azure-monitor-opentelemetry-exporter/pymongo/pytz/gi/apt/apt_pkg. They skip cleanly where the dep is absent and run wherever it is present (e.g. a Linux runner withpython3-giandpython3-aptinstalled).Locally on Linux (Py3.12, with PyGObject and python3-apt installed system-wide) all ten tests pass.