Skip to content

Do we need --specified-platforms-only in stubtest_third_party? #13641

Open

Description

@srittau

When this option is specified (which it is when running in CI), stubtest won't run when a platform is not specified in METADATA.toml. The test is marked as "skipped". When it's not specified (the default), stubtest will run and will most likely case an error.

I noticed this when running stubtest_third_party.py locally on my Linux system and it errored on pywin32.

I suggest we either:

  1. Remove that option altogether and always skip stubtest for stubs not specified in METADATA.toml; or
  2. reverse the logic so that those tests are skipped by default and only generate errors when an explicit option is given.

Activity

  1. AlexWaygood commented on Mar 17, 2025

    @AlexWaygood
    Member

    Added in #9173; it may be useful to review the discussion in that PR thread

  2. srittau commented on Mar 17, 2025

    @srittau
    CollaboratorAuthor

    The original comment by @Avasam was in #8923 (comment):

    @sobolevn & @AlexWaygood There's an unforseen issue: Now I can't run stubtest locally on any stub that doesn't explicitely specify my non-linux OS!

    If no platform is specified in METADATA.toml, it should be allowed to be run on any OS, but the CI should only run linux.

    Which is of course true. I think I slightly misunderstood the purpose of the flag. So another solution:

    1. Always skip running stubtest when the current platform is not specified in tool.stubtest.platforms, if it exists.
  3. added a commit that references this issue on Mar 17, 2025
    b7e1f7a
  4. added a commit that references this issue on Mar 31, 2025
    e7c5593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions