Skip to content

Modernize follow-up: simplify packaging and harden runtime - #5

Merged
by275 merged 14 commits into
masterfrom
modernize-followup
Aug 22, 2026
Merged

by275 merged 14 commits into
masterfrom
modernize-followup

Conversation

@by275

@by275 by275 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Overview

This pull request continues the modernization of the project while preserving its existing proxy behavior and supported protocol surface. The changes establish a cleaner Python 3.12+ baseline, improve packaging and maintainability, add repeatable performance measurements, and strengthen runtime hardening and CI coverage.

What changed

Packaging and runtime baseline

  • Removed the legacy setup.py shim and made pyproject.toml the single source of build and project metadata.
  • Removed an obsolete asyncio task-discovery fallback that is no longer relevant for the supported Python versions.
  • Documented the packaging migration and the practical installation workflow for Git-based use and wheel validation.

Measurement-driven performance work

  • Added pyperf-based benchmark coverage for proxy setup and representative parser/cipher operations.
  • Recorded the benchmark methodology and findings so future optimization work can be compared against a stable baseline.
  • Kept protocol and cryptographic behavior unchanged where measurements did not demonstrate a reliable end-to-end benefit.

API clarity and protocol metadata

  • Added type annotations and focused docstrings to public proxy factories, rule helpers, stream helpers, and protocol registry functions.
  • Added structured protocol capability metadata covering TCP/UDP support, client/server roles, optional dependencies, default ports, and transport modifiers.
  • Preserved the existing two-argument custom protocol registration form while exposing metadata lookup through the public protocol facade.

Robustness and CI

  • Added malformed-input regression tests for HTTP, WebSocket, SOCKS, and authenticated encrypted input paths.
  • Added connection and task lifecycle smoke tests covering repeated short-lived proxy connections, registry shutdown, and UDP protocol eviction.
  • Expanded the core workflow with optimized-test and hardening coverage.
  • Expanded the optional dependency matrix across supported Python versions for the optional protocol integrations.

Compatibility and migration notes

  • Python 3.12+ is the intended runtime baseline for this branch.
  • Existing supported proxy protocols and normal command-line usage remain available.
  • Consumers that invoke python setup.py ... directly must move to standard pip, build, or Git-based installation workflows backed by pyproject.toml.
  • The protocol registry metadata API is additive, and the existing custom registration call shape remains supported.

Validation performed

  • Standard unittest suite: 57 passed.
  • Optimized (python -O) unittest suite: 57 passed.
  • Pytest suite: 57 passed.
  • Bytecode compilation completed successfully.
  • Focused Ruff checks passed for the changed and newly added scope.
  • Workflow YAML files parsed successfully.
  • A clean wheel was built and installed from outside the repository; the installed CLI, imports, public facades, and protocol metadata lookup were verified.

Review focus

Please review the packaging migration, the measured-vs-implemented performance decisions, the public typing/docstring changes, and the lifecycle/malformed-input coverage. The benchmark documentation is intended to provide a baseline for any later optimization that can demonstrate a meaningful end-to-end improvement.

@by275
by275 merged commit 272bbae into master Aug 22, 2026
20 checks passed
@by275
by275 deleted the modernize-followup branch August 22, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant