Skip to content

ci: treat optional backend imports as Any in pyrefly - #5305

Merged
terrykong merged 1 commit into
rnabel/pyrefly-baselinefrom
rnabel/pyrefly-optional-imports
Nov 20, 2026
Merged

terrykong merged 1 commit into
rnabel/pyrefly-baselinefrom
rnabel/pyrefly-optional-imports

Conversation

@RNabel

@RNabel RNabel commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

Removes 39 missing-import errors from the Pyrefly baseline by telling Pyrefly that a few optional packages are not installed in the lint environment.

Issues

None. Stacked on #5298.

Usage

Not applicable: type-checker configuration only.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • The lint job installs the base, dev and build dependencies only, so imports from backend extras and the docs group cannot be resolved there: modelopt (21 errors), sglang and sglang_router (9), transformer_engine (5), and one each for nvidia_resiliency_ext, fla, sentence_transformers and myst_parser.
  • They are added to replace-imports-with-any in pyrefly.toml, the mechanism already used for megatron, vllm, tensorrt_llm and others.
  • pyrefly-baseline.json is pruned with pyrefly check --prune-baseline: 1,610 entries become 1,571. Only missing-import entries are removed and none are added.
  • Typing these packages as Any surfaced no new errors: pyrefly check reported 0 before pruning.
  • One missing-import remains: examples/run_vlm_sft.py imports the sibling script run_sft, which is a path question, not an optional dependency.

No runtime code changes, so there are no new tests and the unit tests were not re-run for this PR.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@RNabel
RNabel requested review from terrykong and yuki-97 November 19, 2026 10:01
@RNabel
RNabel marked this pull request as ready for review November 19, 2026 10:47

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. No qualifying findings in the Pyrefly configuration or baseline changes. The 39 removed records correspond to the eight optional-package namespaces, and unrelated diagnostics are kept.

Static review only. I did not run lint or Pyrefly, and CI status was unavailable.

Generated by Codex

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

The lint environment does not install the backend extras or the docs group,
so imports of modelopt, sglang, transformer_engine and a few others were
reported as missing-import. List them under replace-imports-with-any, as is
already done for megatron and vllm, and prune the 39 baseline entries this
resolves.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Robin Nabel <[email protected]>
@RNabel
RNabel force-pushed the rnabel/pyrefly-optional-imports branch from fa7f281 to 7a22876 Compare November 19, 2026 19:30
@RNabel
RNabel force-pushed the rnabel/pyrefly-baseline branch from 741a817 to a48fc3a Compare November 19, 2026 19:30
@RNabel RNabel added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 19, 2026
@RNabel

RNabel commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7a22876

@terrykong
terrykong merged commit 6e805bc into rnabel/pyrefly-baseline Nov 20, 2026
115 checks passed
@terrykong
terrykong deleted the rnabel/pyrefly-optional-imports branch November 20, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants