Skip to content

Generate strongly typed wrapt wrappers (urllib3 example) - #3

Draft
aabmass wants to merge 2 commits into
mainfrom
push-rvzxmmpxzpsu
Draft

aabmass wants to merge 2 commits into
mainfrom
push-rvzxmmpxzpsu

Conversation

@aabmass

@aabmass aabmass commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Implements the patchgen design (design/patchgen/design.md):

- scripts/patchgen: `lock` (resolves versions from PyPI, introspects
  target signatures in throwaway uv venvs, writes patches.lock.json),
  `generate` (hermetic jinja2 rendering of typed Args dataclasses,
  wrapper Protocols and instrument/uninstrument/instrument_instance
  lifecycle functions) and `check` / `report` (verifies generated
  modules and reports Any type gaps). Run with
  `uv run scripts/patchgen/cli.py`.
- opentelemetry.instrumentation._patching: runtime support used by the
  generated modules (transactional apply/unwind, instance-scope
  patching, shared bind_wrapper dispatcher, version-range selection,
  lock/signature mismatch reporting, rate-limited bind failure logging,
  OTEL_PYTHON_PATCH_STRICT).
- Unit tests for the runtime and the generator.

Assisted-by: Jetski
- Add patches.yaml, patches.lock.json, and generated _patches.py for HTTPConnectionPool.urlopen
- Rewrite wrapper in __init__.py against HttpconnectionpoolUrlopenWrapper and use args.replace_raw(headers=headers)
- Add opentelemetry-instrumentation-urllib3[instruments] to [testenv:typecheck] in tox.ini

Assisted-by: Jetski
@aabmass
aabmass changed the base branch from push-vyqnmrotnzkl to main November 20, 2026 16:23
@aabmass aabmass changed the title Push rvzxmmpxzpsu Generate strongly typed wrapt wrappers (urllib3 example) Nov 20, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant