From 0ccba317b655a97e06cae4d66a9aa26ce609822b Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Wed, 21 Feb 2024 14:48:01 -0500 Subject: [PATCH 1/2] regenerate correct coverage for test files --- .../requirements/{1169f2b.txt => 1420734.txt} | 19 +++++++------- .../requirements/{1335bb4.txt => 173d67d.txt} | 9 +++---- .../requirements/{88a4503.txt => 1b4e915.txt} | 16 ++++++------ .../requirements/{249c8eb.txt => 1b75c2c.txt} | 19 +++++++------- .../requirements/{76e99a0.txt => 1d09d4c.txt} | 18 ++++++------- .../requirements/{1de8d24.txt => 1ed3fbf.txt} | 18 ++++++------- .riot/requirements/3cdaaae.txt | 25 +++++++++++++++++++ .../requirements/{17f3594.txt => dc69f1e.txt} | 9 +++---- riotfile.py | 17 ++++++++++--- 9 files changed, 87 insertions(+), 63 deletions(-) rename .riot/requirements/{1169f2b.txt => 1420734.txt} (58%) rename .riot/requirements/{1335bb4.txt => 173d67d.txt} (83%) rename .riot/requirements/{88a4503.txt => 1b4e915.txt} (60%) rename .riot/requirements/{249c8eb.txt => 1b75c2c.txt} (58%) rename .riot/requirements/{76e99a0.txt => 1d09d4c.txt} (58%) rename .riot/requirements/{1de8d24.txt => 1ed3fbf.txt} (58%) create mode 100644 .riot/requirements/3cdaaae.txt rename .riot/requirements/{17f3594.txt => dc69f1e.txt} (83%) diff --git a/.riot/requirements/1169f2b.txt b/.riot/requirements/1420734.txt similarity index 58% rename from .riot/requirements/1169f2b.txt rename to .riot/requirements/1420734.txt index 08ce911402d..9ff438dd041 100644 --- a/.riot/requirements/1169f2b.txt +++ b/.riot/requirements/1420734.txt @@ -2,27 +2,26 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --no-annotate .riot/requirements/1169f2b.in +# pip-compile --no-annotate .riot/requirements/1420734.in # -attrs==23.1.0 -coverage[toml]==7.3.4 +attrs==23.2.0 +coverage[toml]==7.4.2 exceptiongroup==1.2.0 -greenlet==3.0.2 hypothesis==6.45.0 -importlib-metadata==7.0.0 +importlib-metadata==7.0.1 iniconfig==2.0.0 mock==5.1.0 -mysql-connector-python==8.2.0 +mysql-connector-python==8.3.0 opentracing==2.4.0 packaging==23.2 -pluggy==1.3.0 -protobuf==4.21.12 +pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==8.0.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==2.0.27 tomli==2.0.1 +typing-extensions==4.9.0 zipp==3.17.0 diff --git a/.riot/requirements/1335bb4.txt b/.riot/requirements/173d67d.txt similarity index 83% rename from .riot/requirements/1335bb4.txt rename to .riot/requirements/173d67d.txt index 3cf9c161714..c89deb508f5 100644 --- a/.riot/requirements/1335bb4.txt +++ b/.riot/requirements/173d67d.txt @@ -2,12 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/1335bb4.in +# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/173d67d.in # -attrs==23.1.0 +attrs==23.2.0 coverage[toml]==7.2.7 exceptiongroup==1.2.0 -greenlet==3.0.2 hypothesis==6.45.0 importlib-metadata==6.7.0 iniconfig==2.0.0 @@ -18,12 +17,12 @@ packaging==23.2 pluggy==1.2.0 protobuf==3.20.3 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==7.4.4 pytest-cov==4.1.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==1.3.0 tomli==2.0.1 typing-extensions==4.7.1 zipp==3.15.0 diff --git a/.riot/requirements/88a4503.txt b/.riot/requirements/1b4e915.txt similarity index 60% rename from .riot/requirements/88a4503.txt rename to .riot/requirements/1b4e915.txt index 12d82f785a2..5b80a8ade50 100644 --- a/.riot/requirements/88a4503.txt +++ b/.riot/requirements/1b4e915.txt @@ -2,25 +2,23 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --no-annotate .riot/requirements/88a4503.in +# pip-compile --no-annotate .riot/requirements/1b4e915.in # -attrs==23.1.0 -coverage[toml]==7.3.4 +attrs==23.2.0 +coverage[toml]==7.4.2 exceptiongroup==1.2.0 -greenlet==3.0.3 hypothesis==6.45.0 iniconfig==2.0.0 mock==5.1.0 -mysql-connector-python==8.2.0 +mysql-connector-python==8.3.0 opentracing==2.4.0 packaging==23.2 -pluggy==1.3.0 -protobuf==4.21.12 +pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==8.0.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==1.4.26 tomli==2.0.1 diff --git a/.riot/requirements/249c8eb.txt b/.riot/requirements/1b75c2c.txt similarity index 58% rename from .riot/requirements/249c8eb.txt rename to .riot/requirements/1b75c2c.txt index 48f919ea34f..9b6e23cae34 100644 --- a/.riot/requirements/249c8eb.txt +++ b/.riot/requirements/1b75c2c.txt @@ -2,27 +2,26 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --no-annotate .riot/requirements/249c8eb.in +# pip-compile --no-annotate .riot/requirements/1b75c2c.in # -attrs==23.1.0 -coverage[toml]==7.3.4 +attrs==23.2.0 +coverage[toml]==7.4.2 exceptiongroup==1.2.0 -greenlet==3.0.3 hypothesis==6.45.0 -importlib-metadata==7.0.0 +importlib-metadata==7.0.1 iniconfig==2.0.0 mock==5.1.0 -mysql-connector-python==8.2.0 +mysql-connector-python==8.3.0 opentracing==2.4.0 packaging==23.2 -pluggy==1.3.0 -protobuf==4.21.12 +pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==8.0.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==2.0.27 tomli==2.0.1 +typing-extensions==4.9.0 zipp==3.17.0 diff --git a/.riot/requirements/76e99a0.txt b/.riot/requirements/1d09d4c.txt similarity index 58% rename from .riot/requirements/76e99a0.txt rename to .riot/requirements/1d09d4c.txt index 180f0c4eb7d..1a4ed643b01 100644 --- a/.riot/requirements/76e99a0.txt +++ b/.riot/requirements/1d09d4c.txt @@ -2,27 +2,25 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --no-annotate .riot/requirements/76e99a0.in +# pip-compile --no-annotate .riot/requirements/1d09d4c.in # -attrs==23.1.0 -coverage[toml]==7.3.4 +attrs==23.2.0 +coverage[toml]==7.4.2 exceptiongroup==1.2.0 -greenlet==3.0.3 hypothesis==6.45.0 -importlib-metadata==7.0.0 +importlib-metadata==7.0.1 iniconfig==2.0.0 mock==5.1.0 -mysql-connector-python==8.2.0 +mysql-connector-python==8.3.0 opentracing==2.4.0 packaging==23.2 -pluggy==1.3.0 -protobuf==4.21.12 +pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==8.0.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==1.3.0 tomli==2.0.1 zipp==3.17.0 diff --git a/.riot/requirements/1de8d24.txt b/.riot/requirements/1ed3fbf.txt similarity index 58% rename from .riot/requirements/1de8d24.txt rename to .riot/requirements/1ed3fbf.txt index 9dec5adc3f8..d408b26523f 100644 --- a/.riot/requirements/1de8d24.txt +++ b/.riot/requirements/1ed3fbf.txt @@ -2,27 +2,25 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --no-annotate .riot/requirements/1de8d24.in +# pip-compile --no-annotate .riot/requirements/1ed3fbf.in # -attrs==23.1.0 -coverage[toml]==7.3.4 +attrs==23.2.0 +coverage[toml]==7.4.2 exceptiongroup==1.2.0 -greenlet==3.0.2 hypothesis==6.45.0 -importlib-metadata==7.0.0 +importlib-metadata==7.0.1 iniconfig==2.0.0 mock==5.1.0 -mysql-connector-python==8.2.0 +mysql-connector-python==8.3.0 opentracing==2.4.0 packaging==23.2 -pluggy==1.3.0 -protobuf==4.21.12 +pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==8.0.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==1.3.0 tomli==2.0.1 zipp==3.17.0 diff --git a/.riot/requirements/3cdaaae.txt b/.riot/requirements/3cdaaae.txt new file mode 100644 index 00000000000..de1f85cf71d --- /dev/null +++ b/.riot/requirements/3cdaaae.txt @@ -0,0 +1,25 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# pip-compile --no-annotate .riot/requirements/3cdaaae.in +# +attrs==23.2.0 +coverage[toml]==7.4.2 +exceptiongroup==1.2.0 +hypothesis==6.45.0 +iniconfig==2.0.0 +mock==5.1.0 +mysql-connector-python==8.3.0 +opentracing==2.4.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +pytest==8.0.1 +pytest-cov==4.1.0 +pytest-mock==3.12.0 +pytest-randomly==3.15.0 +sortedcontainers==2.4.0 +sqlalchemy==2.0.27 +tomli==2.0.1 +typing-extensions==4.9.0 diff --git a/.riot/requirements/17f3594.txt b/.riot/requirements/dc69f1e.txt similarity index 83% rename from .riot/requirements/17f3594.txt rename to .riot/requirements/dc69f1e.txt index c56b2e5ddff..a81e8357b21 100644 --- a/.riot/requirements/17f3594.txt +++ b/.riot/requirements/dc69f1e.txt @@ -2,12 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/17f3594.in +# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/dc69f1e.in # -attrs==23.1.0 +attrs==23.2.0 coverage[toml]==7.2.7 exceptiongroup==1.2.0 -greenlet==3.0.2 hypothesis==6.45.0 importlib-metadata==6.7.0 iniconfig==2.0.0 @@ -18,12 +17,12 @@ packaging==23.2 pluggy==1.2.0 protobuf==3.20.3 psycopg2-binary==2.9.9 -pytest==7.4.3 +pytest==7.4.4 pytest-cov==4.1.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.50 +sqlalchemy==2.0.27 tomli==2.0.1 typing-extensions==4.7.1 zipp==3.15.0 diff --git a/riotfile.py b/riotfile.py index 4debb57a3e6..024f89386e2 100644 --- a/riotfile.py +++ b/riotfile.py @@ -1283,7 +1283,7 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): Venv( pys=select_pys(min_version="3.7", max_version="3.9"), pkgs={ - "sqlalchemy": ["~=1.3", "~=1.4"], + "sqlalchemy": ["==1.3.0", latest], "psycopg2-binary": latest, "mysql-connector-python": latest, }, @@ -1292,17 +1292,26 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): # sqlalchemy added support for Python 3.10 in 1.4.26 pys="3.10", pkgs={ - "sqlalchemy": "~=1.4", + "sqlalchemy": ["==1.4.26", latest], "psycopg2-binary": latest, "mysql-connector-python": latest, }, ), # FIXME: tests fail with sqlalchemy 2.0 # Venv( - # # sqlalchemy added support for Python 3.11 in 2.0 + # # sqlalchemy added support for Python 3.11 in 1.4.42 # pys="3.11", # pkgs={ - # "sqlalchemy": ["~=2.0.0", latest], + # "sqlalchemy": ["==1.4.42", latest], + # "psycopg2-binary": latest, + # "mysql-connector-python": latest, + # }, + # ), + # Venv( + # # sqlalchemy added support for Python 3.12 in 2.0.24 + # pys="3.12", + # pkgs={ + # "sqlalchemy": ["==2.0.24", latest], # "psycopg2-binary": latest, # "mysql-connector-python": latest, # }, From bacab45046312ff1ae8c56a85a304c9e54e20b94 Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Thu, 29 Feb 2024 16:51:24 -0500 Subject: [PATCH 2/2] fixes deprecated usage of execute for 2.0 tests --- .riot/requirements/1420734.txt | 6 +-- .riot/requirements/16653b8.txt | 23 ++++++++++ .riot/requirements/16711f6.txt | 23 ++++++++++ .riot/requirements/1b75c2c.txt | 6 +-- .../requirements/{1b4e915.txt => 1e17b32.txt} | 8 ++-- .riot/requirements/2849a6e.txt | 22 ++++++++++ .../requirements/{173d67d.txt => 30cfea5.txt} | 4 +- .riot/requirements/3cdaaae.txt | 6 +-- .../requirements/{1ed3fbf.txt => 6c1588c.txt} | 8 ++-- .../requirements/{1d09d4c.txt => 74b9848.txt} | 8 ++-- .riot/requirements/f348277.txt | 22 ++++++++++ riotfile.py | 44 +++---------------- tests/contrib/sqlalchemy/mixins.py | 5 ++- tests/contrib/sqlalchemy/test_mysql.py | 5 ++- tests/contrib/sqlalchemy/test_patch.py | 7 +-- tests/contrib/sqlalchemy/test_postgres.py | 3 +- tests/contrib/sqlalchemy/test_sqlite.py | 3 +- 17 files changed, 133 insertions(+), 70 deletions(-) create mode 100644 .riot/requirements/16653b8.txt create mode 100644 .riot/requirements/16711f6.txt rename .riot/requirements/{1b4e915.txt => 1e17b32.txt} (76%) create mode 100644 .riot/requirements/2849a6e.txt rename .riot/requirements/{173d67d.txt => 30cfea5.txt} (89%) rename .riot/requirements/{1ed3fbf.txt => 6c1588c.txt} (78%) rename .riot/requirements/{1d09d4c.txt => 74b9848.txt} (78%) create mode 100644 .riot/requirements/f348277.txt diff --git a/.riot/requirements/1420734.txt b/.riot/requirements/1420734.txt index 9ff438dd041..db4c43dd2a9 100644 --- a/.riot/requirements/1420734.txt +++ b/.riot/requirements/1420734.txt @@ -5,7 +5,7 @@ # pip-compile --no-annotate .riot/requirements/1420734.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 importlib-metadata==7.0.1 @@ -16,12 +16,12 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 sqlalchemy==2.0.27 tomli==2.0.1 -typing-extensions==4.9.0 +typing-extensions==4.10.0 zipp==3.17.0 diff --git a/.riot/requirements/16653b8.txt b/.riot/requirements/16653b8.txt new file mode 100644 index 00000000000..fc3e8e603af --- /dev/null +++ b/.riot/requirements/16653b8.txt @@ -0,0 +1,23 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile --no-annotate .riot/requirements/16653b8.in +# +attrs==23.2.0 +coverage[toml]==7.4.3 +hypothesis==6.45.0 +iniconfig==2.0.0 +mock==5.1.0 +mysql-connector-python==8.3.0 +opentracing==2.4.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +pytest==8.0.2 +pytest-cov==4.1.0 +pytest-mock==3.12.0 +pytest-randomly==3.15.0 +sortedcontainers==2.4.0 +sqlalchemy==2.0.27 +typing-extensions==4.10.0 diff --git a/.riot/requirements/16711f6.txt b/.riot/requirements/16711f6.txt new file mode 100644 index 00000000000..052c2511287 --- /dev/null +++ b/.riot/requirements/16711f6.txt @@ -0,0 +1,23 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --no-annotate .riot/requirements/16711f6.in +# +attrs==23.2.0 +coverage[toml]==7.4.3 +hypothesis==6.45.0 +iniconfig==2.0.0 +mock==5.1.0 +mysql-connector-python==8.3.0 +opentracing==2.4.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +pytest==8.0.2 +pytest-cov==4.1.0 +pytest-mock==3.12.0 +pytest-randomly==3.15.0 +sortedcontainers==2.4.0 +sqlalchemy==2.0.27 +typing-extensions==4.10.0 diff --git a/.riot/requirements/1b75c2c.txt b/.riot/requirements/1b75c2c.txt index 9b6e23cae34..ecbaedd93c4 100644 --- a/.riot/requirements/1b75c2c.txt +++ b/.riot/requirements/1b75c2c.txt @@ -5,7 +5,7 @@ # pip-compile --no-annotate .riot/requirements/1b75c2c.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 importlib-metadata==7.0.1 @@ -16,12 +16,12 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 sqlalchemy==2.0.27 tomli==2.0.1 -typing-extensions==4.9.0 +typing-extensions==4.10.0 zipp==3.17.0 diff --git a/.riot/requirements/1b4e915.txt b/.riot/requirements/1e17b32.txt similarity index 76% rename from .riot/requirements/1b4e915.txt rename to .riot/requirements/1e17b32.txt index 5b80a8ade50..3c33c77d9a0 100644 --- a/.riot/requirements/1b4e915.txt +++ b/.riot/requirements/1e17b32.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --no-annotate .riot/requirements/1b4e915.in +# pip-compile --no-annotate .riot/requirements/1e17b32.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -15,10 +15,10 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.4.26 +sqlalchemy==1.3.24 tomli==2.0.1 diff --git a/.riot/requirements/2849a6e.txt b/.riot/requirements/2849a6e.txt new file mode 100644 index 00000000000..3c1571ed191 --- /dev/null +++ b/.riot/requirements/2849a6e.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --no-annotate .riot/requirements/2849a6e.in +# +attrs==23.2.0 +coverage[toml]==7.4.3 +hypothesis==6.45.0 +iniconfig==2.0.0 +mock==5.1.0 +mysql-connector-python==8.3.0 +opentracing==2.4.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +pytest==8.0.2 +pytest-cov==4.1.0 +pytest-mock==3.12.0 +pytest-randomly==3.15.0 +sortedcontainers==2.4.0 +sqlalchemy==1.3.24 diff --git a/.riot/requirements/173d67d.txt b/.riot/requirements/30cfea5.txt similarity index 89% rename from .riot/requirements/173d67d.txt rename to .riot/requirements/30cfea5.txt index c89deb508f5..64e5b9fe5c5 100644 --- a/.riot/requirements/173d67d.txt +++ b/.riot/requirements/30cfea5.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/173d67d.in +# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/30cfea5.in # attrs==23.2.0 coverage[toml]==7.2.7 @@ -22,7 +22,7 @@ pytest-cov==4.1.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 sortedcontainers==2.4.0 -sqlalchemy==1.3.0 +sqlalchemy==1.3.24 tomli==2.0.1 typing-extensions==4.7.1 zipp==3.15.0 diff --git a/.riot/requirements/3cdaaae.txt b/.riot/requirements/3cdaaae.txt index de1f85cf71d..12741e036f3 100644 --- a/.riot/requirements/3cdaaae.txt +++ b/.riot/requirements/3cdaaae.txt @@ -5,7 +5,7 @@ # pip-compile --no-annotate .riot/requirements/3cdaaae.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -15,11 +15,11 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 sqlalchemy==2.0.27 tomli==2.0.1 -typing-extensions==4.9.0 +typing-extensions==4.10.0 diff --git a/.riot/requirements/1ed3fbf.txt b/.riot/requirements/6c1588c.txt similarity index 78% rename from .riot/requirements/1ed3fbf.txt rename to .riot/requirements/6c1588c.txt index d408b26523f..688786e2d78 100644 --- a/.riot/requirements/1ed3fbf.txt +++ b/.riot/requirements/6c1588c.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --no-annotate .riot/requirements/1ed3fbf.in +# pip-compile --no-annotate .riot/requirements/6c1588c.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 importlib-metadata==7.0.1 @@ -16,11 +16,11 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.3.0 +sqlalchemy==1.3.24 tomli==2.0.1 zipp==3.17.0 diff --git a/.riot/requirements/1d09d4c.txt b/.riot/requirements/74b9848.txt similarity index 78% rename from .riot/requirements/1d09d4c.txt rename to .riot/requirements/74b9848.txt index 1a4ed643b01..23ab5ac44a5 100644 --- a/.riot/requirements/1d09d4c.txt +++ b/.riot/requirements/74b9848.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --no-annotate .riot/requirements/1d09d4c.in +# pip-compile --no-annotate .riot/requirements/74b9848.in # attrs==23.2.0 -coverage[toml]==7.4.2 +coverage[toml]==7.4.3 exceptiongroup==1.2.0 hypothesis==6.45.0 importlib-metadata==7.0.1 @@ -16,11 +16,11 @@ opentracing==2.4.0 packaging==23.2 pluggy==1.4.0 psycopg2-binary==2.9.9 -pytest==8.0.1 +pytest==8.0.2 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -sqlalchemy==1.3.0 +sqlalchemy==1.3.24 tomli==2.0.1 zipp==3.17.0 diff --git a/.riot/requirements/f348277.txt b/.riot/requirements/f348277.txt new file mode 100644 index 00000000000..1b9bee412fb --- /dev/null +++ b/.riot/requirements/f348277.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile --no-annotate .riot/requirements/f348277.in +# +attrs==23.2.0 +coverage[toml]==7.4.3 +hypothesis==6.45.0 +iniconfig==2.0.0 +mock==5.1.0 +mysql-connector-python==8.3.0 +opentracing==2.4.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +pytest==8.0.2 +pytest-cov==4.1.0 +pytest-mock==3.12.0 +pytest-randomly==3.15.0 +sortedcontainers==2.4.0 +sqlalchemy==1.3.24 diff --git a/riotfile.py b/riotfile.py index 024f89386e2..12ead4b98bd 100644 --- a/riotfile.py +++ b/riotfile.py @@ -1279,44 +1279,12 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): }, venvs=[ Venv( - venvs=[ - Venv( - pys=select_pys(min_version="3.7", max_version="3.9"), - pkgs={ - "sqlalchemy": ["==1.3.0", latest], - "psycopg2-binary": latest, - "mysql-connector-python": latest, - }, - ), - Venv( - # sqlalchemy added support for Python 3.10 in 1.4.26 - pys="3.10", - pkgs={ - "sqlalchemy": ["==1.4.26", latest], - "psycopg2-binary": latest, - "mysql-connector-python": latest, - }, - ), - # FIXME: tests fail with sqlalchemy 2.0 - # Venv( - # # sqlalchemy added support for Python 3.11 in 1.4.42 - # pys="3.11", - # pkgs={ - # "sqlalchemy": ["==1.4.42", latest], - # "psycopg2-binary": latest, - # "mysql-connector-python": latest, - # }, - # ), - # Venv( - # # sqlalchemy added support for Python 3.12 in 2.0.24 - # pys="3.12", - # pkgs={ - # "sqlalchemy": ["==2.0.24", latest], - # "psycopg2-binary": latest, - # "mysql-connector-python": latest, - # }, - # ), - ], + pys=select_pys(min_version="3.7", max_version="3.12"), + pkgs={ + "sqlalchemy": ["~=1.3.0", latest], + "psycopg2-binary": latest, + "mysql-connector-python": latest, + }, ), ], ), diff --git a/tests/contrib/sqlalchemy/mixins.py b/tests/contrib/sqlalchemy/mixins.py index da9e73319c5..92334a2a71b 100644 --- a/tests/contrib/sqlalchemy/mixins.py +++ b/tests/contrib/sqlalchemy/mixins.py @@ -4,6 +4,7 @@ from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import create_engine +from sqlalchemy import text from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker @@ -147,7 +148,7 @@ def test_session_query(self): def test_engine_connect_execute(self): # ensures that engine.connect() is properly traced with self.connection() as conn: - rows = conn.execute("SELECT * FROM players").fetchall() + rows = conn.execute(text("SELECT * FROM players")).fetchall() assert len(rows) == 0 traces = self.pop_traces() @@ -173,7 +174,7 @@ def test_opentracing(self): with ot_tracer.start_active_span("sqlalch_op"): with self.connection() as conn: - rows = conn.execute("SELECT * FROM players").fetchall() + rows = conn.execute(text("SELECT * FROM players")).fetchall() assert len(rows) == 0 traces = self.pop_traces() diff --git a/tests/contrib/sqlalchemy/test_mysql.py b/tests/contrib/sqlalchemy/test_mysql.py index 5de744b8323..a66c5308bff 100644 --- a/tests/contrib/sqlalchemy/test_mysql.py +++ b/tests/contrib/sqlalchemy/test_mysql.py @@ -1,4 +1,5 @@ import pytest +from sqlalchemy import text from sqlalchemy.exc import ProgrammingError from ddtrace.constants import ERROR_MSG @@ -34,7 +35,7 @@ def test_engine_execute_errors(self): # ensures that SQL errors are reported with pytest.raises(ProgrammingError): with self.connection() as conn: - conn.execute("SELECT * FROM a_wrong_table").fetchall() + conn.execute(text("SELECT * FROM a_wrong_table")).fetchall() traces = self.pop_traces() # trace composition @@ -72,7 +73,7 @@ def tearDown(self): def _generate_span(self): with pytest.raises(ProgrammingError): with self.connection() as conn: - conn.execute("SELECT * FROM a_wrong_table").fetchall() + conn.execute(text("SELECT * FROM a_wrong_table")).fetchall() traces = self.pop_traces() span = traces[0][0] diff --git a/tests/contrib/sqlalchemy/test_patch.py b/tests/contrib/sqlalchemy/test_patch.py index 43b1c834d49..75dfb79db9a 100644 --- a/tests/contrib/sqlalchemy/test_patch.py +++ b/tests/contrib/sqlalchemy/test_patch.py @@ -1,4 +1,5 @@ import sqlalchemy +from sqlalchemy import text from ddtrace import Pin from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY @@ -40,7 +41,7 @@ def tearDown(self): def test_engine_traced(self): # ensures that the engine is traced - rows = self.conn.execute("SELECT 1").fetchall() + rows = self.conn.execute(text("SELECT 1")).fetchall() assert len(rows) == 1 traces = self.pop_traces() @@ -58,7 +59,7 @@ def test_engine_traced(self): def test_engine_pin_service(self): # ensures that the engine service is updated with the PIN object Pin.override(self.engine, service="replica-db") - rows = self.conn.execute("SELECT 1").fetchall() + rows = self.conn.execute(text("SELECT 1")).fetchall() assert len(rows) == 1 traces = self.pop_traces() @@ -93,7 +94,7 @@ def test_analytics_sample_rate(self): ] for config, metric_value in matrix: with self.override_config("sqlalchemy", config): - self.conn.execute("SELECT 1").fetchall() + self.conn.execute(text("SELECT 1")).fetchall() root = self.get_root_span() assert_is_measured(root) diff --git a/tests/contrib/sqlalchemy/test_postgres.py b/tests/contrib/sqlalchemy/test_postgres.py index 8c0322af4bb..3a767a96a38 100644 --- a/tests/contrib/sqlalchemy/test_postgres.py +++ b/tests/contrib/sqlalchemy/test_postgres.py @@ -1,5 +1,6 @@ import psycopg2 import pytest +from sqlalchemy import text from sqlalchemy.exc import ProgrammingError from ddtrace.constants import ERROR_MSG @@ -33,7 +34,7 @@ def test_engine_execute_errors(self): # ensures that SQL errors are reported with pytest.raises(ProgrammingError): with self.connection() as conn: - conn.execute("SELECT * FROM a_wrong_table").fetchall() + conn.execute(text("SELECT * FROM a_wrong_table")).fetchall() traces = self.pop_traces() # trace composition diff --git a/tests/contrib/sqlalchemy/test_sqlite.py b/tests/contrib/sqlalchemy/test_sqlite.py index be4a6711b89..92d625f0ebd 100644 --- a/tests/contrib/sqlalchemy/test_sqlite.py +++ b/tests/contrib/sqlalchemy/test_sqlite.py @@ -1,4 +1,5 @@ import pytest +from sqlalchemy import text from sqlalchemy.exc import OperationalError from ddtrace.constants import ERROR_MSG @@ -26,7 +27,7 @@ def test_engine_execute_errors(self): # ensures that SQL errors are reported with pytest.raises(OperationalError): with self.connection() as conn: - conn.execute("SELECT * FROM a_wrong_table").fetchall() + conn.execute(text("SELECT * FROM a_wrong_table")).fetchall() traces = self.pop_traces() # trace composition