Skip to content

dulwich: remove redundant encode#10675

Merged
radoering merged 1 commit into
python-poetry:mainfrom
radoering:dulwich-redundant-encode
Dec 30, 2025
Merged

dulwich: remove redundant encode#10675
radoering merged 1 commit into
python-poetry:mainfrom
radoering:dulwich-redundant-encode

Conversation

@radoering
Copy link
Copy Markdown
Member

@radoering radoering commented Dec 30, 2025

minor addition regarding #10674

The encode() was necessary with dulwich 0.24.10, but is not anymore with dulwich 0.25.0. See jelmer/dulwich#2036

Summary by Sourcery

Enhancements:

  • Simplify Git remote reference fetching by passing the transport path string directly to dulwich instead of encoding it to bytes.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Dec 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Git backend and integration tests to stop encoding the path argument when calling dulwich’s fetch API, reflecting that dulwich 0.25.0 now expects a str rather than bytes.

Sequence diagram for Git fetch using dulwich 0.25.0 without encode

sequenceDiagram
    participant PoetryGitBackend
    participant DulwichClient
    participant LocalRepo

    PoetryGitBackend->>LocalRepo: open context manager
    activate LocalRepo
    PoetryGitBackend->>DulwichClient: fetch(path, LocalRepo, determine_wants_all)
    activate DulwichClient
    note over DulwichClient: path is now str (no encode)
    DulwichClient->>LocalRepo: determine_wants_all
    DulwichClient->>LocalRepo: update object_store
    DulwichClient-->>PoetryGitBackend: FetchPackResult
    deactivate DulwichClient
    PoetryGitBackend->>LocalRepo: close context manager
    deactivate LocalRepo
Loading

File-Level Changes

Change Details Files
Align dulwich client.fetch usage with dulwich 0.25.0 by passing path as a str instead of bytes.
  • Update test helper _remote_refs to pass path directly to client.fetch without calling encode().
  • Update Git backend _fetch_remote_refs to pass path directly to client.fetch without calling encode().
tests/integration/test_utils_vcs_git.py
src/poetry/vcs/git/backend.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@radoering radoering force-pushed the dulwich-redundant-encode branch from 75e4017 to 182769e Compare December 30, 2025 11:34
@radoering radoering enabled auto-merge (squash) December 30, 2025 11:37
@radoering radoering merged commit 9676185 into python-poetry:main Dec 30, 2025
54 checks passed
@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 Jan 30, 2026
@radoering radoering deleted the dulwich-redundant-encode branch May 1, 2026 07:47
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.

2 participants