pypa / pypa/setuptools

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

Open
#5,243 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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 https://github.com/pypa/setuptools/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No specific file or test is named; start in the setuptools build backend where packaging warnings and Trove classifiers are handled. Done means non-blocking warnings cover the stated py.typed, -stubs, and Typing classifier combinations, while packages with either Typing :: Stubs Only or Typing :: Typed do not warn.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.