Skip to content

fix(py): align anonymous client API with httpx - #310

Merged
barjin merged 13 commits into
masterfrom
fix/no-client-api-equality
Nov 10, 2025
Merged

barjin merged 13 commits into
masterfrom
fix/no-client-api-equality

Conversation

@barjin

@barjin barjin commented Nov 10, 2025

Copy link
Copy Markdown
Member

Aligns anonymous client API (e.g. impit.get()) with httpx capabilities. Adds proxy tests to the JS version of the package.

closes #308

@barjin
barjin requested a review from Copilot November 10, 2025 09:29
@barjin barjin self-assigned this Nov 10, 2025
@github-actions github-actions Bot added this to the 127th sprint - Tooling team milestone Nov 10, 2025
@github-actions github-actions Bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Nov 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown

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 HTTP proxy support and a streaming API to both the Python and Node.js implementations of Impit. It bumps the version from 0.7.3 to 0.8.0 for Python and includes related dependency updates.

Key changes:

  • Adds HTTP proxy support alongside existing SOCKS proxy support for both Python and Node.js
  • Introduces a new stream() function for Python's client-less API
  • Extends client-less API functions with proxy, follow_redirects, max_redirects, cookie_jar, and cookies parameters
  • Adds proxy server testing infrastructure using pproxy (Python) and proxy-chain (Node.js)

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
impit-python/uv.lock Updates package versions (0.7.3 → 0.8.0) and adds pproxy 2.7.9 dependency; updates exceptiongroup typing-extensions marker
impit-python/test/setup_proxy.py New utility module for starting/stopping pproxy test server
impit-python/test/no_client_test.py New comprehensive test suite for client-less API including proxy, redirects, cookies, and streaming
impit-python/test/basic_client_test.py Adds HTTP proxy test case for Client class
impit-python/test/async_client_test.py Adds HTTP proxy test case for AsyncClient class
impit-python/src/lib.rs Implements new stream() function and extends client-less API functions with proxy/redirect/cookie parameters
impit-python/python/impit/impit.pyi Adds type stubs for new stream() function and extended parameters on client-less API functions
impit-python/python/impit/init.py Exports new stream function
impit-python/pyproject.toml Adds pproxy>=2.7.9 dev dependency and mypy ignore configuration for pproxy
impit-node/yarn.lock Updates package versions to 0.7.0 and adds proxy-chain 2.5.9 dependency
impit-node/test/mock.server.ts Adds runProxyServer utility for testing HTTP proxy functionality
impit-node/test/basics.test.ts Extends proxy tests to include HTTP proxy alongside SOCKS4/5
impit-node/package.json Adds proxy-chain dev dependency and reorders optionalDependencies alphabetically

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

// Start the local server
await getServer();
// Start the proxy server
await getProxyServer()

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

Missing semicolon at the end of the statement.

Suggested change
await getProxyServer()
await getProxyServer();

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +11
from impit import Cookies, StreamClosed, StreamConsumed, TooManyRedirects

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

Module 'impit' is imported with both 'import' and 'import from'.

Suggested change
from impit import Cookies, StreamClosed, StreamConsumed, TooManyRedirects

Copilot uses AI. Check for mistakes.
@barjin
barjin merged commit 1179c6e into master Nov 10, 2025
53 checks passed
@barjin
barjin deleted the fix/no-client-api-equality branch November 11, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify interface between impit.get and httpx.get

3 participants