Skip to content

build: relax wrapt version constraint in pyproject.toml#3930

Closed
Atry wants to merge 1 commit intoopen-telemetry:mainfrom
Atry:patch-1
Closed

build: relax wrapt version constraint in pyproject.toml#3930
Atry wants to merge 1 commit intoopen-telemetry:mainfrom
Atry:patch-1

Conversation

@Atry
Copy link
Copy Markdown

@Atry Atry commented Nov 9, 2025

Description

Relax the wrapt version constraint from < 2.0.0 to < 3.0.0 to allow compatibility with wrapt 2.x.

Fixes #3903

Background

The current constraint wrapt >= 1.0.0, < 2.0.0 unnecessarily prevents users from using wrapt 2.x. This is an unnecessary limitation because the APIs used by opentelemetry-instrumentation (wrap_function_wrapper and ObjectProxy) remain compatible in wrapt 2.x.

Changes

Updated the wrapt version constraint in the following packages:

  • opentelemetry-instrumentation
  • opentelemetry-processor-baggage
  • 19 instrumentation packages:
    • opentelemetry-instrumentation-aio-pika
    • opentelemetry-instrumentation-aiohttp-client
    • opentelemetry-instrumentation-aiohttp-server
    • opentelemetry-instrumentation-aiopg
    • opentelemetry-instrumentation-asyncio
    • opentelemetry-instrumentation-boto3sqs
    • opentelemetry-instrumentation-cassandra
    • opentelemetry-instrumentation-click
    • opentelemetry-instrumentation-confluent-kafka
    • opentelemetry-instrumentation-dbapi
    • opentelemetry-instrumentation-elasticsearch
    • opentelemetry-instrumentation-grpc
    • opentelemetry-instrumentation-httpx
    • opentelemetry-instrumentation-jinja2
    • opentelemetry-instrumentation-pika
    • opentelemetry-instrumentation-pymemcache
    • opentelemetry-instrumentation-pyramid
    • opentelemetry-instrumentation-threading
    • opentelemetry-instrumentation-urllib3

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Verified that uv lock --check passes (the locked wrapt version in uv.lock remains unchanged)
  • The change only relaxes upper bound constraints, so existing functionality is preserved

Does This PR Require a Core Repo Change?

  • 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

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Nov 9, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Atry / name: Yang, Bo (d35bd3d)

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Nov 11, 2025

We have to update all the entries, not just opentelemetry-instrumentation:

git grep wrapt.*2 | grep pyproject.toml
instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml:    "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-click/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-pika/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-redis/pyproject.toml:  "wrapt >= 1.12.1",
instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml:  "wrapt >= 1.11.2",
instrumentation/opentelemetry-instrumentation-threading/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
opentelemetry-instrumentation/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",
processor/opentelemetry-processor-baggage/pyproject.toml:  "wrapt >= 1.0.0, < 2.0.0",

@Atry Atry marked this pull request as ready for review December 6, 2025 19:05
@Atry Atry requested a review from a team as a code owner December 6, 2025 19:05
@Atry
Copy link
Copy Markdown
Author

Atry commented Dec 6, 2025

@xrmx Updated. Would you mind reviewing it again?

Update all pyproject.toml files that had "wrapt >= 1.0.0, < 2.0.0"
constraint to "wrapt >= 1.0.0, < 3.0.0" to allow wrapt 2.x.

Updated packages:
- opentelemetry-instrumentation
- opentelemetry-processor-baggage
- 20 instrumentation packages

Also update uv.lock to use wrapt 2.0.1 for CI testing. This change
only affects the development lockfile used for testing.

End users are not affected as the version constraint allows both
wrapt 1.x and 2.x - users can continue using whichever version
their package manager resolves.
@Atry Atry changed the title build: relief wrapt version constraint in pyproject.toml build: relax wrapt version constraint in pyproject.toml Dec 6, 2025
- `opentelemetry-instrumentation-redis`: add missing copyright header for opentelemetry-instrumentation-redis
([#3976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3976))

### Changed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be moved under unreleased and keep it under the Added chapter

Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

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

Please merge main and redo the uv.lock update since there's conflicts there

@xrmx xrmx moved this to Approved PRs that need fixes in Python PR digest Dec 11, 2025
@mariojonke
Copy link
Copy Markdown
Contributor

i believe the isinstance(func, ObjectProxy) in unwrap with wrapt v2 will now always return false.
this will likely break uninstrument in most instrumentors since this is where unwrap is mostly used.

it would probably be good to adapt some of the test requirements files to run the tests also with wrapt v2

@xrmx xrmx self-requested a review December 11, 2025 14:57
@xrmx xrmx moved this from Approved PRs that need fixes to Reviewed PRs that need fixes in Python PR digest Dec 11, 2025
@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Dec 11, 2025

Indeed it needs fixes:

diff --git a/opentelemetry-instrumentation/pyproject.toml b/opentelemetry-instrumentation/pyproject.toml
index 0e5820e0d..147f42163 100644
--- a/opentelemetry-instrumentation/pyproject.toml
+++ b/opentelemetry-instrumentation/pyproject.toml
@@ -27,7 +27,7 @@ classifiers = [
 dependencies = [
   "opentelemetry-api ~= 1.4",
   "opentelemetry-semantic-conventions == 0.61b0.dev",
-  "wrapt >= 1.0.0, < 2.0.0",
+  "wrapt >= 1.0.0, < 3.0.0",
   "packaging >= 18.0",
 ]
 
diff --git a/opentelemetry-instrumentation/test-requirements.txt b/opentelemetry-instrumentation/test-requirements.txt
index 58c09a950..86462950c 100644
--- a/opentelemetry-instrumentation/test-requirements.txt
+++ b/opentelemetry-instrumentation/test-requirements.txt
@@ -1,5 +1,4 @@
 asgiref==3.8.1
-Deprecated==1.2.14
 gevent==25.5.1
 iniconfig==2.0.0
 packaging==24.0
@@ -8,6 +7,6 @@ py-cpuinfo==9.0.0
 pytest==7.4.4
 tomli==2.0.1
 typing_extensions==4.12.2
-wrapt==1.16.0
+wrapt==2.0.0
 zipp==3.19.2
 -e opentelemetry-instrumentation

gets 5 test failures.

Other users of ObjectProxy other than opentelemetry-instrumentation are:

  • opentelemetry-instrumentation-dbapi
  • instrumentation/opentelemetry-instrumentation-botocore
  • instrumentation/opentelemetry-instrumentation-aiopg
  • instrumentation/opentelemetry-instrumentation-grpc
  • instrumentation/opentelemetry-instrumentation-pika

@blarghmatey
Copy link
Copy Markdown
Contributor

What's the status of this work? It is currently a blocker for me being able to use this SDK for one of my applications.

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Feb 12, 2026

@blarghmatey the status of this work is that we two incomplete PRs open, feel free to open a third one with proper tests

@blarghmatey
Copy link
Copy Markdown
Contributor

@xrmx thank you for the follow-up. I'll try to get something opened shortly to address the needs. I appreciate all of the hard work from you and the other Python OTel maintainers!

blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 13, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
@blarghmatey blarghmatey mentioned this pull request Feb 13, 2026
6 tasks
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 13, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
@blarghmatey
Copy link
Copy Markdown
Contributor

@xrmx when you have time I opened #4203

I'm happy to address any feedback or changes that you identify. Thanks!

blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 17, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 17, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 17, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 20, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 25, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Feb 27, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Mar 5, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

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 Mar 6, 2026
blarghmatey added a commit to mitodl/opentelemetry-python-contrib that referenced this pull request Mar 6, 2026
- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes open-telemetry#3903
Related to open-telemetry#3930 and open-telemetry#4082
@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Mar 9, 2026

Closing as superseded by #4203

@xrmx xrmx closed this Mar 9, 2026
@github-project-automation github-project-automation bot moved this from Reviewed PRs that need fixes to Done in Python PR digest Mar 9, 2026
@xrmx xrmx mentioned this pull request Mar 11, 2026
11 tasks
xrmx added a commit that referenced this pull request Mar 11, 2026
* Add support for wrapt 2.x

- Update wrapt version constraint from '>=1.0.0, <2.0.0' to '>=1.0.0' in all affected packages
- Replace ObjectProxy with BaseObjectProxy where iteration support is not needed
- Add fallback import for wrapt 1.x compatibility (ObjectProxy as BaseObjectProxy)
- Keep ObjectProxy usage in classes that implement __iter__ (botocore, aiopg)
- Update CHANGELOG.md

This change maintains backward compatibility with wrapt 1.x while enabling
support for wrapt 2.x. BaseObjectProxy is the new base class in wrapt 2.x,
while ObjectProxy is now a subclass that adds __iter__() support.

Fixes #3903
Related to #3930 and #4082

* Restructure wrapt test requirements

- Remove wrapt from base test-requirements.txt (installed via pyproject.toml)
- Remove Deprecated from base test-requirements.txt (version conflicts with wrapt 2.x)
- Create test-requirements-wrapt1.txt with wrapt<2.0.0 and Deprecated==1.2.14
- Create test-requirements-wrapt2.txt with wrapt>=2.0.0 and Deprecated>=1.2.18
- Update tox.ini to use requirements files instead of factor-based deps
- Add Deprecated to lint environment deps

This follows the pattern used by other packages (botocore, httpx) and
resolves dependency conflicts where Deprecated 1.2.14 requires wrapt<2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: Resolve conflicts and add Wrapt 3 as upper bound

* Add wrapt 1.x/2.x test matrix for all ObjectProxy-using instrumentations

Extend the wrapt1/wrapt2 test matrix to all instrumentations that use
wrapt.ObjectProxy or wrapt.BaseObjectProxy: botocore, dbapi, grpc, pika,
aiopg, httpx, and asyncpg.

Changes:
- tox.ini: Add {wrapt1,wrapt2} factor to envlist for all 7 packages;
  update deps to reference per-version test-requirements files
- botocore/pyproject.toml: Add missing wrapt dependency (>= 1.0.0, < 3.0.0)
- All base test-requirements files: Remove pinned wrapt== and Deprecated==
- New test-requirements-wrapt1.txt / test-requirements-wrapt2.txt files for
  each package (using Deprecated>=1.2.18 for wrapt2 to avoid conflict with
  Deprecated==1.2.14 which requires wrapt<2)
- Regenerate GitHub Actions workflows (including new test_3.yml due to
  expanded job count)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix CI failures: ruff formatting and lint wrapt version pin

- utils.py: reformat multi-condition if statement to satisfy ruff line
  length requirement (fixes generate/precommit CI jobs)
- tox.ini: pin wrapt>=1.0.0,<2.0.0 for lint envs of botocore, dbapi,
  grpc, and sio-pika; with wrapt 1.x removed from base test-requirements,
  lint envs were getting wrapt 2.x which caused pylint no-member errors
  on __wrapped__ (a C-extension attribute not visible to static analysis)
  Also add Deprecated==1.2.14 to same lint envs for consistency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix remaining CI failures: unused imports and uv.lock

- dbapi/__init__.py: remove unused bare 'import wrapt' (F401); the
  compat shim imports BaseObjectProxy directly from wrapt
- grpc/_aio_server.py: remove unused 'import wrapt' (F401) and fix
  import ordering (I001) flagged by ruff pre-commit hook
- uv.lock: regenerate after adding wrapt dependency to botocore
  pyproject.toml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix aiopg lint wrapt pin, uv.lock format, and ruff blank lines

- tox.ini: pin wrapt>=1.0.0,<2.0.0 + Deprecated==1.2.14 for
  lint-instrumentation-aiopg; aiopg source uses __wrapped__ heavily and
  pylint's no-member error appeared when wrapt 2.x was installed
- uv.lock: regenerate using pre-commit hook (uv v0.9.30) to fix
  trailing-slash format on registry URLs
- httpx/test_httpx_integration.py: add blank line before try/except
  block (ruff I001/E303 formatting fix)
- pika/utils.py: add blank line before try/except block (same ruff fix)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix pylint E0611: disable no-name-in-module for BaseObjectProxy compat shim

pylint with wrapt 1.x installed reports E0611 ('No name BaseObjectProxy
in module wrapt') when it sees the try/except ImportError compat shim,
even though the except branch provides a fallback. Add a per-line
pylint disable comment to suppress this false positive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix asyncpg test: use BaseObjectProxy compat shim for wrapt 2.x

In wrapt 2.x, BoundFunctionWrapper no longer subclasses ObjectProxy
(it subclasses BaseObjectProxy instead). Update the test to use
the compat shim so isinstance checks pass with both wrapt 1.x and 2.x.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review comments: add wrapt 2.0.0+ comments and fix CHANGELOG

- Add '# wrapt 2.0.0+' comment above BaseObjectProxy import in all
  try/except compat shim blocks to clarify why the pattern is used
- Fix CHANGELOG.md PR link from #XXXX to #4203

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* chore: Update changelog and workflows

* Apply suggestions from code review

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* fix: Update workflows again

* Apply suggestions from code review

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* Remove Deprecated version pins from test-requirements and tox.ini

Deprecated>=1.2.14 was pinned because Deprecated==1.2.14 requires
wrapt<2. Since pip automatically resolves compatible versions based
on the wrapt constraint in each test env, explicit Deprecated pins
are unnecessary. Remove them from all test-requirements-wrapt*.txt
files and from lint env deps in tox.ini.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove stale .orig file leftover from rebase

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move lint env wrapt pins from tox.ini into test-requirements files

All dependencies should be managed via requirements.txt files rather
than inline in tox.ini. Move wrapt>=1.0.0,<2.0.0 pins for lint
environments into their respective test-requirements files:
- instrumentation-grpc/test-requirements-1.txt
- instrumentation-botocore/test-requirements-1.txt
- instrumentation-dbapi/test-requirements.txt
- instrumentation-aiopg/test-requirements.txt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply suggestions from code review

* Update instrumentation/opentelemetry-instrumentation-botocore/test-requirements-1.txt

* Update instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt

* Update instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt

* Update instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt

* Address latest PR feedback: botocore compat shim, exact wrapt versions, lint env refs

- botocore/bedrock_utils.py: apply BaseObjectProxy compat shim to
  ConverseStreamWrapper and InvokeModelWithResponseStreamWrapper (both
  classes define __iter__ so BaseObjectProxy is correct)
- All test-requirements-wrapt1.txt: pin wrapt==1.17.3 (exact version)
- All test-requirements-wrapt2.txt: pin wrapt==2.1.2 (exact version)
- tox.ini lint envs: switch to -wrapt2.txt files so lint runs with
  wrapt 2.x; remove wrapt pin from base test-requirements files
  (grpc/test-requirements-1.txt, botocore/test-requirements-1.txt,
  dbapi/test-requirements.txt, aiopg/test-requirements.txt)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: add pylint disable=no-member for __wrapped__ and abstract-method usages

Add pylint: disable=no-member to all class definitions and usages of
__wrapped__ that are invisible to pylint when using wrapt's C extension
proxy types (BaseObjectProxy/ObjectProxy).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Support wrapt 2.0 in pyproject.toml

5 participants