Skip to content

[1.2] Ensure repository deletion is consistent#6231

Merged
neersighted merged 1 commit intopython-poetry:1.2from
neersighted:backport_6214
Aug 25, 2022
Merged

[1.2] Ensure repository deletion is consistent#6231
neersighted merged 1 commit intopython-poetry:1.2from
neersighted:backport_6214

Conversation

@neersighted
Copy link
Copy Markdown
Member

Backport of #6214

This change improves the consistency of `Pool().remove_repository()` to make it easier to write poetry plugins which mutate the repository pool.

1.  Deleting an element from the middle of `Pool()._repositories` decrements the index of later entries.  Update `Pool()._lookup` to reflect this.

2.  If a primary repository is deleted, decrement `Pool()._secondary_start_idx` to ensure that any additional primary repositories are still added before all secondary repositories.

3.  If the default repository is deleted, reset `Pool()._default` so a new one can be added.

Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com>
@neersighted neersighted merged commit 721301c into python-poetry:1.2 Aug 25, 2022
@neersighted neersighted deleted the backport_6214 branch August 25, 2022 07:07
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants