docs: note VCS ignore interaction with packages (#10831)#10835
Open
SarthakB11 wants to merge 2 commits intopython-poetry:mainfrom
Open
docs: note VCS ignore interaction with packages (#10831)#10835SarthakB11 wants to merge 2 commits intopython-poetry:mainfrom
SarthakB11 wants to merge 2 commits intopython-poetry:mainfrom
Conversation
The 'packages' subsection of docs/pyproject.md did not mention that entries are still subject to the VCS ignore settings that seed the exclude field (documented in the sibling 'exclude and include' subsection). This caught a user out on python-poetry#10831 where a package path pointing at generated code excluded by .gitignore silently produced empty distributions. Adds a small warning block to the 'packages' subsection explaining the interaction and pointing to the 'exclude and include' subsection for the include-with-format workaround. Refs python-poetry#10831
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider tightening the warning text to split the long sentence into two (e.g. one for the VCS-ignore behavior and a second for the generated-code scenario) to improve readability and make the key behavior easier to scan.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider tightening the warning text to split the long sentence into two (e.g. one for the VCS-ignore behavior and a second for the generated-code scenario) to improve readability and make the key behavior easier to scan.
## Individual Comments
### Comment 1
<location path="docs/pyproject.md" line_range="702-705" />
<code_context>
+{{% warning %}}
+If a VCS is being used, files matched by its ignore settings (for example by
+`.gitignore` for git) are excluded from the built distributions even when their
+parent directory is listed under `packages`. This can be surprising if a
+`packages` entry points at generated code or another path that is intentionally
</code_context>
<issue_to_address>
**nitpick (typo):** Consider adding a comma after "for example" and capitalizing "Git".
You could rephrase to something like "(for example, by `.gitignore` for Git)" so that "for example" is followed by a comma and the VCS name is capitalized.
```suggestion
{{% warning %}}
If a VCS is being used, files matched by its ignore settings (for example, by
`.gitignore` for Git) are excluded from the built distributions even when their
parent directory is listed under `packages`. This can be surprising if a
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Refs #10831.
What
Adds a short warning block to the
packagessubsection ofdocs/pyproject.mdexplaining that files matched by VCS ignore settings (e.g..gitignore) are excluded from the built distributions even when their parent directory is listed underpackages, and points readers toexclude and includefor the include-with-format workaround.Why
On #10831 the reporter listed a generated-code directory under
packagesbut had the same directory in.gitignore, andpoetry buildsilently produced emptysdist/wheelarchives. @dimbleby correctly pointed out that the behaviour is documented in theexclude and includesubsection, but the reporter noted (and I agree) that thepackagessubsection itself does not mention the cross-talk — which is exactly where a user going from "I want to include this directory" to "my build is empty" lands first.Quoting the reporter's refined ask on 2026-04-09:
Diff
Thus, you only have to specify the directory where your root package resides. {{% /note %}} +{{% warning %}} +If a VCS is being used, files matched by its ignore settings (for example by +`.gitignore` for git) are excluded from the built distributions even when their +parent directory is listed under `packages`. This can be surprising if a +`packages` entry points at generated code or another path that is intentionally +kept out of version control. To ship such files, add them back via +[`include`]({{< relref "#exclude-and-include" >}}) with an explicit `format`. +{{% /warning %}} + ### exclude and includeNo code change, no behaviour change — docs-only, 9 lines added.