Skip to content
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

feat: psycopg2-binary support #515

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ get_current_span().add_event('<error-message>', {'lumigo.type': '<error-type>'})
| pika | [pika](https://pypi.org/project/pika) | 1.0.0|1.0.0|1.0.0|1.0.0|1.0.0|
| | | 1.0.1~1.3.0| 1.0.1~1.3.0| 1.0.1~1.3.0| 1.0.1~1.3.0| 1.0.1~1.3.0|
| | | 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2|
| psycopg2 | [psycopg2](https://pypi.org/project/psycopg2) | 2.9|2.9|2.9|2.9.5|2.9.5|
| psycopg2 | [psycopg2-binary](https://pypi.org/project/psycopg2-binary) | 2.9|2.9|2.9|2.9.5|2.9.5|
| | [psycopg2](https://pypi.org/project/psycopg2) | 2.9|2.9|2.9|2.9.5|2.9.5|
| pymongo | [pymongo](https://pypi.org/project/pymongo) | 3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|
| | | 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.13.0|
| | | 4.0.1~4.5.0| 4.0.1~4.5.0| 4.0.1~4.5.0| 4.0.1~4.5.0| 4.0.1~4.5.0|
Expand Down
15 changes: 10 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,26 +799,31 @@ def integration_tests_pika(

@nox.session()
@nox.parametrize(
"python,psycopg2_version",
"python,dependency_name,psycopg2_version",
[
(python, psycopg2_version)
(python, dependency_name, psycopg2_version)
for python in python_versions()
for dependency_name in ["psycopg2", "psycopg2-binary"]
for psycopg2_version in dependency_versions_to_be_tested(
python=python,
directory="psycopg2",
dependency_name="psycopg2",
dependency_name=dependency_name,
)
],
)
def integration_tests_psycopg2(
session,
python,
dependency_name,
psycopg2_version,
):
with TestedVersions.save_tests_result(
"psycopg2", python, "psycopg2", psycopg2_version
"psycopg2",
python,
dependency_name=dependency_name,
dependency_version=psycopg2_version,
):
install_package("psycopg2", psycopg2_version, session)
install_package(dependency_name, psycopg2_version, session)

session.install(".")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def check_if_applicable(self) -> None:
def install_instrumentation(self) -> None:
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor

Psycopg2Instrumentor().instrument()
# if we don't skip the dependency check, the instrumentor will fail
# because it can't detect psycopg2-binary
Psycopg2Instrumentor().instrument(skip_dep_check=True)


instrumentor: AbstractInstrumentor = Psycopg2Instrumentor()
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!2.9
!2.9.1
!2.9.2
!2.9.3
!2.9.4
2.9.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!2.9
!2.9.1
!2.9.2
!2.9.3
!2.9.4
2.9.5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.9
Loading