Repository navigation
fix(publish): report a comprehensible error for a missing repository url - #11114
Merged
radoering merged 1 commit intoNov 15, 2026
Merged
Conversation
This was referenced Sep 29, 2026
`poetry publish -r <name>` only reported
Repository <name> is not defined
which neither names the actual problem nor tells the user how to solve it.
That message was also shown when the repository is configured but has no
url, which is the configuration that broke every command in python-poetry#11080.
The error is now a `PoetryError` that distinguishes both cases and points
to the command that fixes them:
The repository 'my-repo' is not defined. Please set it with
`poetry config repositories.my-repo <url>`.
The repository 'my-repo' is missing a url. Please set it with
`poetry config repositories.my-repo <url>`.
Signed-off-by: kokokoXUY <[email protected]>
radoering
force-pushed
the
fix/publish-missing-repository-url
branch
from
November 15, 2026 06:04
1da7cc2 to
c09e4b4
Compare
radoering
approved these changes
Nov 15, 2026
radoering
enabled auto-merge (squash)
November 15, 2026 06:06
mwalbeck
pushed a commit
to mwalbeck/docker-python-poetry
that referenced
this pull request
Nov 28, 2026
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [poetry](https://github.com/python-poetry/poetry) ([changelog](https://python-poetry.org/history/)) | patch | `2.5.1` → `2.5.2` | --- ### Release Notes <details> <summary>python-poetry/poetry (poetry)</summary> ### [`v2.5.2`](https://github.com/python-poetry/poetry/blob/HEAD/CHANGELOG.md#252---2026-11-21) [Compare Source](python-poetry/poetry@2.5.1...2.5.2) ##### Changed - Allow `pkginfo>=2.0` ([#​11239](python-poetry/poetry#11239)). - Report a comprehensible error if a configured repository is missing a URL ([#​11081](python-poetry/poetry#11081), [#​11114](python-poetry/poetry#11114), [#​11242](python-poetry/poetry#11242)). - Report a comprehensible error for an invalid `--priority` in `poetry source add` instead of failing with a `KeyError` ([#​11175](python-poetry/poetry#11175)). ##### Fixed - Fix an issue where `poetry install` built an sdist before checking it against its lock file hash ([#​11253](python-poetry/poetry#11253)). - Fix an issue where `poetry install` rejected a distribution even though one of the hashes provided by the package index matched the hash locked for that file. ([#​11131](python-poetry/poetry#11131)). - Fix an issue where uninstalling a path dependency failed if its source did not exist anymore ([#​11093](python-poetry/poetry#11093)). - Fix an issue where `poetry version prerelease` failed for a dev release ([#​11217](python-poetry/poetry#11217)). ##### Docs - Document the options of `poetry debug resolve` ([#​11211](python-poetry/poetry#11211)). - Clarify `solver.min-release-age-exclude` and `solver.min-release-age-exclude-source` ([#​11087](python-poetry/poetry#11087)). - Distinguish package and upload repository URLs ([#​11143](python-poetry/poetry#11143)). - Explain the certificate configuration for system Git ([#​11145](python-poetry/poetry#11145)). - Add separate directory and archive path dependency examples ([#​11079](python-poetry/poetry#11079)). - Use the plugin repository for the `poetry-export` pre-commit hook ([#​11213](python-poetry/poetry#11213)). - Fix the incorrect `tool.poetry` section name in the FAQ ([#​11150](python-poetry/poetry#11150)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI2MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.walbeck.it/mwalbeck/docker-python-poetry/pulls/1778
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.
Summary
poetry publish -r <name>reported an error that neither identified theactual problem nor told the user how to fix it:
This is now a
PoetryErrorthat distinguishes the two cases and points tothe command that fixes them:
Motivation
In #11080 radoering summarized the desired behavior of a repository that is
configured without a
url(e.g. an empty[repositories.<name>]section inconfig.toml):#11081 fixes the
TypeErrorthat such a configuration caused while Poetrywas starting, so a repository without a url no longer breaks every command.
Publishing to it, however, still ended in the message quoted above, which is
why this PR only implements the comprehensible error. It is independent of
#11081: the "not defined" case exists today, and the "missing a url" case
becomes reachable once the startup
TypeErroris fixed.The error is raised at the point where the repository is actually used
instead of while collecting the configured repositories, so that Poetry
stays usable and the configuration can be repaired:
Tests
tests/publishing/test_publisher.py::test_publish_raises_error_for_undefined_repositoryto assert the new message.
tests/publishing/test_publisher.py::test_publish_raises_error_for_repository_without_urlfor a repository that is configured without a url.
ruff check,ruff format --checkandmypyare clean for the changedfiles.