Skip to content

Conversation

@yanyongyu
Copy link
Owner

resolve #245

@yanyongyu yanyongyu added the enhancement New feature or request label Oct 25, 2025
@yanyongyu yanyongyu requested a review from Copilot October 25, 2025 12:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for custom HTTPX transport configuration to the GitHub client, enabling users to inject custom transport implementations for both sync and async operations. This is particularly useful for unit testing scenarios where mock transports can stub API responses without making real HTTP calls.

  • Added transport and async_transport parameters to the GitHub client configuration
  • Updated the client creation logic to use custom transports when provided
  • Added comprehensive documentation and test examples demonstrating mock transport usage

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
githubkit/config.py Added transport fields to Config dataclass and get_config function
githubkit/core.py Updated GitHubCore init overloads and client creation methods to support custom transports
githubkit/github.py Added transport parameters to GitHub class init overloads
tests/test_unit_test/test_mock_transport.py New test file demonstrating sync and async mock transport usage
docs/usage/unit-test.md Added documentation section explaining how to use test transports for mocking
docs/usage/configuration.md Added documentation for the new transport configuration options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yanyongyu yanyongyu merged commit 989a60e into master Oct 25, 2025
38 checks passed
@yanyongyu yanyongyu deleted the feat/config-transport branch October 25, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: support custom transport for internal httpx client

2 participants