docs: drop the invented --srcdir option from the basic-usage how-to - #1186
Open
hxperl wants to merge 3 commits into
Open
docs: drop the invented --srcdir option from the basic-usage how-to#1186hxperl wants to merge 3 commits into
hxperl wants to merge 3 commits into
Conversation
docs/how-to/basic-usage.rst offers `python -m build --srcdir path/to/project` as the explicit form of the positional source directory. There is no such option: `srcdir` is the parser's only positional argument and has no long- option alias, so the documented command exits 2 with `error: unrecognized arguments: --srcdir`. `--srcdir` has never existed in the parser. `git log -S` finds the string only in a77870d, the Diataxis docs reorganization (pypa#988) that wrote this page, so this is a documentation error rather than a flag that was renamed or removed. Replace the block with a sentence saying the source directory is positional. Adding a `--srcdir` alias to the parser would be the other way to make the page true, but that is a new option and a maintainer decision, not a docs fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DyaZ48KuBpkPpfPui9xCUK
hxperl
requested review from
gaborbernat,
henryiii and
layday
as code owners
September 11, 2026 05:26
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DyaZ48KuBpkPpfPui9xCUK
Author
|
Added the changelog fragment as |
pre-commit.ci was the only failing check. The repo runs docstrfmt with `-l 120` over .rst files and the fragment was 140 characters on one line. Wrapping it was not an option: filling to 120 puts the break immediately before "- by :user:`hxperl`", and a line starting with "- " is a bullet list in reStructuredText, so the reflow would have changed what the fragment means rather than just how it looks. Shortened the sentence instead. 103 characters, one line, which is in line with the rest of docs/changelog (the longest existing fragment is 118). The point being made is unchanged: there is no --srcdir option.
henryiii
reviewed
Sep 11, 2026
| .. code-block:: console | ||
|
|
||
| $ python -m build --srcdir path/to/project | ||
| The source directory is positional; there is no option form. |
Contributor
There was a problem hiding this comment.
I think we can remove this line too, as long as we don't indicate it that it's optional, I don't think we need to state it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
docs/how-to/basic-usage.rsttells the reader that the positional source directory has an explicit option form:There is no
--srcdiroption.srcdiris the parser's only positional argument (__main__.py:541,nargs='?') and it has no long-option alias, so the second command does not run:(run against
mainat 65b46ef)This is not a flag that was renamed or removed.
git log -S '--srcdir'finds the string in exactly one commit — a77870d, the Diátaxis reorganization (#988) that wrote this page — and never insrc/.I checked the rest of the docs the same way, by pulling every
python -m build/pyproject-buildcommand line out ofdocs/andREADME.mdand validating each flag against the parser. The only other unrecognized strings are-C--build-option=--build-number=123and-C=--my-setting(backend config-setting values, correct as written) anduvx --from build ...(a uvx flag). So this is the only occurrence.The change
I removed the "Or explicitly" block and replaced it with a sentence saying the source directory is positional.
The judgement call: the other way to make the page true is to add a
--srcdiralias to the parser, which would also spare anyone who has already copied the documented command. I did not do that because it is a new option rather than a docs fix, and it is your call whetherbuildwants one. Happy to switch if you would rather keep the documented spelling working.What I verified
main, before touching anything.sphinx-build -W -n -b html docsandproselint check docs— the two commands in[env.docs]— both succeed before and after the change.pytest tests -n 4:3 failed, 296 passed, 49 skipped. The three failures are an artefact of my own setup, not this change: I ran fromPYTHONPATH=srcwithout installing the package, so the subprocesses those tests spawn fail withModuleNotFoundError: No module named 'build'. This PR touches one.rstfile and no code.I have not added the changelog fragment yet because the filename needs this PR's number — I will push
docs/changelog/<n>.doc.rstas soon as the number exists.Checklist
sphinx-build -W -n,proselint)Disclosure: this was found and drafted with AI assistance (Claude Code). The reproduction, the docs build, the test run and the
git log -Shistory check are real runs on my machine, and I reviewed the change before opening this.