pypa / pypa/setuptools

[FR] option for making unknown arguments to setup into a hard error

Open
#3,602 4 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?

Sometimes users attempt to install build dependencies themselves (such as cffi). When they mess this up, and then run setup.py, the unknown options passed to setup.py become a warning, which users often miss in the large output.

The ability to make these into an exception would ensure users catch their errors early.

Describe the solution you'd like

A setup() argument (setup.cfg as well, I suppose) like error_on_unknown=True that changes https://github.com/pypa/setuptools/blob/ba3995e5705a22e13bb5d2231ac22c77e4417747/setuptools/_distutils/dist.py#L261-L262 into an exception, instead of a warning.

Alternative Solutions

No response

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

Start by reading setuptools/_distutils/dist.py around the unknown-argument warning referenced in the issue, then trace how setup.py and setup.cfg arguments reach that code. The work is done when an opt-in setup() setting makes unknown arguments raise an exception instead of only warning, with the requested configuration path addressed if supported.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.