Skip to content

[FR] warn on packaging a py.typed marker but missing the Typing :: * classifier #5243

Description

@Avasam

What's the problem this feature will solve?

A typed project or partial stubs-only package will ship a py.typed marker as per https://typing.python.org/en/latest/spec/distributing.html#packaging-type-information

But it's easy to forget to also add the appropriate Trove Classifier for discoverability. The setuptools build backend already outputs warnings in some scenarios (for example: deprecated classifiers). It feels well within scope to warn about incorrect or missing classifiers.

Describe the solution you'd like

warn on packaging a py.typed marker but missing the Typing :: * classifier

In this case, having either Typing :: Stubs Only or Typing :: Typed should be enough to avoid the warning I'm suggesting.

Inversely, having the classifier in a package that doesn't ship a py.typed file OR ends in -stubs (the package module name, not the distribution) should also be a warning.

Alternative Solutions

This is different than #1021 as this isn't auto-inserting anything, just showing a non-blocker warning.

Additional context

No response

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.enhancement
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions