-
Notifications
You must be signed in to change notification settings - Fork 859
cassandra: use _instruments_any instead of _instruments for driver deps #4182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
cassandra: use _instruments_any instead of _instruments for driver deps #4182
Conversation
fdcc855 to
b27f1e3
Compare
935feab to
f96edf4
Compare
xrmx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I think you are missing one piece of the puzzle that is to test both the implementation and not just one.
In short you have to split the test-requirements.txt in one for cassandra-driver and the other for scylla-driver and update tox.ini accordingly.
The split plus a ton of unrelated changes are available in this PR https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4180/changes
f96edf4 to
51d855b
Compare
andreamatt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done — split test requirements into separate files for cassandra-driver and scylla-driver, with separate tox environments for each. Both pass:
py313-test-instrumentation-cassandra-driver: 8/8 passedpy312-test-instrumentation-cassandra-scylla: 8/8 passed
51d855b to
7ba9c50
Compare
The cassandra instrumentation listed both cassandra-driver and scylla-driver in _instruments, which requires ALL listed packages to be installed. Since users install one OR the other (they are alternative drivers for the same API), this should use _instruments_any so that having either driver installed is sufficient. This follows the same pattern already used by psycopg2 and kafka-python instrumentations, introduced in open-telemetry#3610. Co-authored-by: Cursor <[email protected]>
7ba9c50 to
de3f0f8
Compare
Signed-off-by: emdneto <[email protected]>
Signed-off-by: emdneto <[email protected]>
…/opentelemetry-python-contrib into fix/cassandra-instruments-any
Description
The cassandra instrumentation listed both
cassandra-driverandscylla-driverin_instruments, which requires all listed packages to be installed. Since users install one or the other (they are alternative drivers for the samecassandra.clusterAPI), this should use_instruments_anyso that having either driver installed is sufficient.This follows the same pattern already used by the psycopg2 and kafka-python instrumentations, introduced in #3610. Cassandra was the only remaining instrumentation with multiple alternative packages listed under
_instrumentsinstead of_instruments_any.Also splits test requirements into separate files for each driver and adds separate tox/CI environments to test both independently.
Fixes #2819
Type of change
How Has This Been Tested?
DependencyConflict: requested: "scylla-driver ~= 3.25" but found: "None"when onlycassandra-driveris installed (3/4 tests fail)instrumentation_dependencies()covering all four cases: only cassandra-driver, only scylla-driver, both installed, neither installedpy313-test-instrumentation-cassandra-driver: 8/8 passedpy312-test-instrumentation-cassandra-scylla: 8/8 passedtox -e generateandtox -e generate-workflowsto regenerate filesDoes This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.