Repository navigation
fix(publish): keep the dist dir a single argument when building - #11171
Merged
radoering merged 2 commits intoOct 30, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/console/commands/test_publish.py" line_range="244" />
<code_context>
+
+ if dist_dir == "absolute":
+ output_dir = target_dir / "my dist"
+ else:
+ output_dir = target_dir / dist_dir
+
</code_context>
<issue_to_address>
**Relative-path case is never exercised**
When the `, `target_dir / dist_dir` makes the `
Use a relative `output_dir` for the relative parameter and resolve the expected artifact location against the project directory for assertions.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the quoted output path is still parsed incorrectly, the build could leave generated artifacts in the wrong directory. Those files remain after a revert, but they can be removed and the build rerun.
Blocking findings: tests/console/commands/test_publish.py:244
simpleqt
force-pushed
the
fix/publish-dist-dir-with-spaces
branch
from
October 29, 2026 05:28
205525a to
f9a6ed1
Compare
`poetry publish --build --dist-dir <dir>` passed the output directory to the build command as part of an argument string, which cleo parses with its own tokenizer. A directory containing whitespace was therefore split into several arguments: the artifacts were written to a truncated directory and publish aborted with "No files to publish". The directory is now quoted (and normalized) before it is handed over.
radoering
force-pushed
the
fix/publish-dist-dir-with-spaces
branch
from
October 30, 2026 16:50
f9a6ed1 to
f1a29b2
Compare
radoering
approved these changes
Oct 30, 2026
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.
Problem
poetry publish --build --dist-dir <dir>passes the directory to the build command as a plain string:cleo wraps that string in a
StringInput, whose token parser splits on whitespace, so a directory that contains a space — common on Windows, and possible in any absolute path — arrives as two arguments. The build then writes its artifacts to a truncated directory (e.g.<project>/myinstead of<project>/my dist) andpublishaborts with the misleadingNo files to publishand exit code 1.Change
The value is quoted and normalized before it is handed over.
Path()drops a trailing separator that would otherwise swallow the closing quote, and"is escaped, which cleo honours inside such a token — Windows backslashes are unaffected:Tests
tests/console/commands/test_publish.py::test_publish_dist_dir_with_spaces_and_build_options(parametrized over a relative and an absolute directory containing a space, offline:simple_projectfixture plus theresponsesmock). It fails onmain—assert 1 == 0, with the artifacts written to a bogusmydirectory — and passes with the change. The pre-existing assertion that pinned the unquoted argument string was updated.tests/console/commands/test_publish.pyis 20 passed;test_build.py+test_publish.py+tests/publishingare 101 passed.Prepared with AI assistance; every line was verified by running the cases above.