Skip to content

Resolve UP043 TODO - #401

Open
Avasam (Avasam) wants to merge 3 commits into
microsoft:mainfrom
Avasam:Resolve-UP043-TODO
Open

Avasam (Avasam) wants to merge 3 commits into
microsoft:mainfrom
Avasam:Resolve-UP043-TODO

Conversation

@Avasam

Copy link
Copy Markdown
Contributor

Removes the 2nd and 3rd params of Generator if they are None or Any, matching typeshed (default typevar is None, but Anys are auto insertion where it was unknown or didn't matter. typeshed simply collapses them to default).

Also when 3rd param was NoReturn whilst overlapping an existing Union.

@bschnurr

Bill Schnurr (bschnurr) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

Comment thread stubs/sympy-stubs/solvers/diophantine/diophantine.pyi Outdated
@bschnurr

Copy link
Copy Markdown
Member

Result: ⚠️ partially-verified

Verification details

Verification: Isolated verification observed failures that were not classified as caused by this PR: Ruff checks for changed stub areas, Ruff formatting for changed stub areas, Dependency and test discovery. The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Summary: The targeted UP043 Ruff check passed, and all 667 relevant stub files passed Ruff formatting. No tests were added by the PR. Full mypy, Pyright, and stubtest validation could not run because the sandbox lacked required dependencies and the repository provides no lockfile for permitted offline installation. Confidence is therefore partial; the only observed failures were environment-related or in an unchanged README snippet.

Test runs: 2 passed, 3 failed, 3 not run

  • ❌ Failed | unrelated to this PR | Ruff checks for changed stub areas | python -m ruff check pyproject.toml stubs/matplotlib stubs/sklearn/_config.pyi stubs/sympy-stubs
  • ❌ Failed | unrelated to this PR | Ruff formatting for changed stub areas | python -m ruff format --check pyproject.toml stubs/matplotlib stubs/sklearn/_config.pyi stubs/sympy-stubs
  • ⚠️ Not run | Mypy repository checks | python -m mypy . --python-version=3.13
  • ⚠️ Not run | Pyright repository checks | python -m pyright
  • ⚠️ Not run | Stubtest for affected packages | python tests/run_stubtest.py sympy-stubs sklearn
  • ❌ Failed | unrelated to this PR | Dependency and test discovery | printf 'profile=%s\n' "$AUTOMATION_SANDBOX_PROFILE"; printf '%s\n' '--- manifests ---'; find . -maxdepth 2 -type f ( -name 'uv.lock' -o -name 'requirements*.txt' -o -name 'package-lock.json' -o -name 'pnpm-lock.yaml' ) -print; printf '%s\n' '--- python/tools ---'; python --version; python - <<'PY'
    import importlib.util
    for name in ('ruff','mypy','pyright','pytest','sympy','sklearn','matplotlib'):
    spec=importlib.util.find_spec(name)
    print(f'{name}: {spec.origin if spec else "missing"}')
    PY
    printf '%s\n' '--- changed files ---'; git diff --name-status HEAD^ HEAD; printf '%s\n' '--- test changes ---'; git diff --name-status HEAD^ HEAD -- tests .github
  • ✅ Passed | UP043 lint across all stubs | python -m ruff check --select UP043 pyproject.toml stubs
  • ✅ Passed | Ruff formatting for Python stub files | find stubs/matplotlib stubs/sympy-stubs -name '*.pyi' -print0 | xargs -0 python -m ruff format --check pyproject.toml stubs/sklearn/_config.pyi
❌ Ruff checks for changed stub areas diagnostic output
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\bschnurr\\AppData\\Local\\Temp\\automation-job-ready-r9ka842l'
❌ Ruff formatting for changed stub areas diagnostic output
unformatted: File would be reformatted
  --> stubs/sympy-stubs/README.md:23:1
1 file would be reformatted, 667 files already formatted
⚠️ Mypy repository checks diagnostic output
Required runtime/type-test dependencies such as sympy, sklearn, and matplotlib were absent; no lockfile or locked requirements are available for permitted offline installation.
⚠️ Pyright repository checks diagnostic output
Pyright was not installed, and no locked offline dependency source was available.
⚠️ Stubtest for affected packages diagnostic output
The corresponding runtime packages were absent from the sandbox.
❌ Dependency and test discovery diagnostic output
profile=generic
Python 3.13.15
ruff: installed
mypy: installed
pyright: missing
pytest: installed
sympy: missing
sklearn: missing
matplotlib: missing
error: Could not access 'HEAD^'
warning: Not a git repository.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:changes-requested Automated review: posted blocking findings to address. label Sep 21, 2026
@bschnurr

Copy link
Copy Markdown
Member

Result: ⚠️ partially-verified

Verification details

Verification: Isolated verification observed failures whose relationship to this PR could not be determined: Ruff repository lint, Mypy for affected stub packages; this review is not fully verified. Isolated verification observed failures that were not classified as caused by this PR: Ruff formatter.

Summary: The focused UP043 lint check passed across all stubs. Full lint and formatting were blocked by unrelated baseline findings under Ruff 0.16.4 rather than the pinned 0.15 series. Targeted mypy, Pyright, and stubtest verification was blocked by missing offline dependencies and no lockfile. No tests were added, so verification is partial.

Test runs: 2 passed, 3 failed, 2 not run

  • ❌ Failed | relationship unknown | Ruff repository lint | python -m ruff check .
  • ❌ Failed | unrelated to this PR | Ruff formatter | python -m ruff --version && python -m ruff format --check .
  • ❌ Failed | relationship unknown | Mypy for affected stub packages | python -m mypy stubs/matplotlib/animation.pyi stubs/matplotlib/pyplot.pyi stubs/sklearn/_config.pyi stubs/sympy-stubs
  • ⚠️ Not run | Pyright type check | python -m pyright
  • ⚠️ Not run | Stubtest for affected runtime packages | python tests/run_stubtest.py sklearn sympy-stubs
  • ✅ Passed | UP043 lint regression check | python -m ruff check --select UP043 stubs
  • ✅ Passed | Dependency and test discovery | printf '%s\n' "AUTOMATION_SANDBOX_PROFILE=${AUTOMATION_SANDBOX_PROFILE:-}"; git diff --name-status HEAD^ HEAD; printf '\nTest entrypoints:\n'; find tests -maxdepth 2 -type f -print | sort; printf '\nDependency state:\n'; test -d .venv && echo '.venv present' || echo '.venv absent'; command -v uv || true; command -v python || true; python - <<'PY'
    import importlib.util
    for name in ('ruff', 'mypy', 'pyright', 'pytest', 'sympy', 'sklearn', 'matplotlib'):
    print(f'{name}: {"available" if importlib.util.find_spec(name) else "missing"}')
    PY
❌ Ruff repository lint diagnostic output
RUF036 [*] `None` not at the end of the type union.
  --> stubs/matplotlib/_api/__init__.pyi:23:15
23 |     category: None | type[MatplotlibDeprecationWarning] = ...,
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
❌ Ruff formatter diagnostic output
ruff 0.16.4
unformatted: File would be reformatted
  --> stubs/sympy-stubs/README.md:23:1
1 file would be reformatted, 1291 files already formatted
❌ Mypy for affected stub packages diagnostic output
stubs/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.pyi:4:1: error: Cannot find implementation or library stub for module named "numpy" [import-not-found]
stubs/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.pyi:5:1: error: Library stubs not installed for "scipy.sparse" [import-untyped]
⚠️ Pyright type check diagnostic output
Discovery reported that the pyright module is unavailable.
⚠️ Stubtest for affected runtime packages diagnostic output
Discovery reported that sklearn and sympy are unavailable; no dependency lockfile permits an offline bootstrap.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants