Skip to content

fix: Limit inputs to action#141

Open
Ahajha wants to merge 1 commit into
bazel-contrib:mainfrom
Ahajha:trotta/limit-inputs
Open

fix: Limit inputs to action#141
Ahajha wants to merge 1 commit into
bazel-contrib:mainfrom
Ahajha:trotta/limit-inputs

Conversation

@Ahajha

@Ahajha Ahajha commented Jul 6, 2026

Copy link
Copy Markdown

In our codebase, we have a long chain of C++ compilation that ends up getting fed to our Python targets and, by extension, these mypy actions. Since mypy doesn't actually import anything, these compiled artifacts are unnecessary.

This uses a different method to grab the things that mypy will look at, those being transitive .py and .pyi files.

In our codebase, we have a long chain of C++ compilation that ends up getting fed to our Python targets and, by extension, these mypy actions. Since mypy doesn't actually import anything, these compiled artifacts are unnecessary.

This uses a different method to grab the things that mypy _will_ look at, those being transitive .py and .pyi files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 249bd89a12

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread mypy/private/mypy.bzl
Comment on lines +134 to +136
if RulesPythonPyInfo in dep:
depsets.append(dep[RulesPythonPyInfo].transitive_sources)
depsets.append(dep[RulesPythonPyInfo].transitive_pyi_files)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve py_type_library directories as inputs

When users configure types=... in mypy(), this loop also visits the generated py_type_library targets from additional_types; those targets provide PyTypeLibraryInfo, not RulesPythonPyInfo, so this replacement stops adding their declared stub directory to the action inputs. The code still puts dep[PyTypeLibraryInfo].directory.path + "/site-packages" on MYPYPATH below, so in sandboxed or remote execution that path is missing and mypy cannot load the mapped stub package, breaking the advertised types mapping.

Useful? React with 👍 / 👎.

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.

1 participant