diff --git a/Makefile b/Makefile index 4964cb62..0ee1db30 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,12 @@ venv: python3.10 -m venv .venv echo 'run `source .venv/bin/activate` to start develop asyncDB' -setup: - pip install wheel==0.40.0 +install: + pip install wheel==0.42.0 pip install -e . develop: - pip install wheel==0.40.0 + pip install wheel==0.42.0 pip install -e .[all] pip install -Ur docs/requirements-dev.txt flit install --symlink diff --git a/asyncdb/drivers/pg.py b/asyncdb/drivers/pg.py index c36053cb..16710d99 100644 --- a/asyncdb/drivers/pg.py +++ b/asyncdb/drivers/pg.py @@ -217,7 +217,8 @@ async def connect(self): "application_name": self.application_name, "idle_in_transaction_session_timeout": "60min", "idle_session_timeout": "60min", - "max_parallel_workers": "512" + "statement_timeout": "60min", + "tcp_keepalives_idle": "30min" } server_settings = {**server_settings, **self._server_settings} if self.ssl: diff --git a/asyncdb/version.py b/asyncdb/version.py index c5cc2864..64fc27f1 100644 --- a/asyncdb/version.py +++ b/asyncdb/version.py @@ -3,7 +3,7 @@ __title__ = 'asyncdb' __description__ = ('Library for Asynchronous data source connections ' 'Collection of asyncio drivers.') -__version__ = '2.5.11' +__version__ = '2.6.0' __author__ = 'Jesus Lara' __author_email__ = 'jesuslarag@gmail.com' __license__ = 'BSD' diff --git a/docs/requirements-dev.txt b/docs/requirements-dev.txt index deaa3ed9..5f94c441 100644 --- a/docs/requirements-dev.txt +++ b/docs/requirements-dev.txt @@ -1,17 +1,21 @@ aiounittest==1.4.2 -black==23.1.0 +black==23.11.0 +build==1.0.3 coverage[toml]==7.2.7 flit==3.9.0 -hypothesis==6.68.0 -ipython==8.10.0 +hypothesis==6.91.0 +ipython==8.14.0 lint==1.2.1 -mypy==1.3.0 +mypy==1.7.1 pylint==2.16.1 +pyperf==2.6.2 pytest>=6.0.0 -pytest-asyncio==0.21.1 +pytest-asyncio==0.23.2 pytest-cov==4.0.0 pytest-cython==0.2.0 -pytest-xdist==3.3.1 +pytest-xdist==3.5.0 pytest-assume==2.4.3 +sdist==0.0.0 sphinx==6.1.3 tox==4.6.4 +twine==4.0.2 diff --git a/examples/test_pg.py b/examples/test_pg.py index 5b6669bd..28f657ae 100644 --- a/examples/test_pg.py +++ b/examples/test_pg.py @@ -32,6 +32,9 @@ async def connect(c): sql = 'REFRESH MATERIALIZED VIEW epson.vw_form_data;' result, error = await conn.execute(sql) exec_time = (datetime.now() - start).total_seconds() + sql = 'TRUNCATE troc.employees_raw;' + result, error = await conn.execute(sql) + exec_time = (datetime.now() - start).total_seconds() if not error: print(result) diff --git a/pyproject.toml b/pyproject.toml index fd2856b0..b85286af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ 'setuptools==67.6.1', - 'Cython==0.29.33', - 'wheel==0.40.0' + 'Cython==3.0.6', + 'wheel==0.42.0' ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 5061ce8d..34b9a6a8 100644 --- a/setup.py +++ b/setup.py @@ -88,6 +88,7 @@ def readme(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Framework :: AsyncIO", ], @@ -98,14 +99,14 @@ def readme(): license=__license__, setup_requires=[ "setuptools==67.6.1", - "Cython==0.29.33", - "wheel==0.40.0" + "Cython==3.0.6", + "wheel==0.42.0" ], install_requires=[ "numpy==1.24.2", - "cryptography==37.0.4", - "aiohttp==3.8.6", - "asyncpg==0.28.0", + "cryptography==41.0.7", + "aiohttp==3.9.1", + "asyncpg==0.29.0", "uvloop==0.19.0", "asyncio==3.4.3", "faust-cchardet==2.1.18", @@ -114,14 +115,13 @@ def readme(): "openpyxl==3.1.2", "lz4==4.3.2", "typing_extensions==4.8.0", - "urllib3==1.26.14", "charset-normalizer>=2.0.7", "ciso8601==2.3.0", "iso8601==1.1.0", "pgpy==0.6.0", "python-magic==0.4.27", "dateparser==1.1.8", - "python-datamodel>=0.2.1", + "python-datamodel>=0.5.0", "aiosqlite>=0.18.0", "pendulum==2.1.2" ], @@ -134,9 +134,9 @@ def readme(): "cassandra-driver==3.28.0", "rethinkdb==2.4.9", "influxdb==5.3.1", - "influxdb-client[async]==1.36.1", + "influxdb-client[async]==1.39.0", "pymssql==2.2.7", - "redis==4.5.5", + "redis==5.0.1", "duckdb==0.8.1", "deltalake==0.13.0" ], @@ -144,8 +144,8 @@ def readme(): "dask==2023.3.0", "python-datatable==1.1.3", "polars==0.19.12", - "pyarrow==13.0.0", - "connectorx==0.3.1", + "pyarrow==14.0.1", + "connectorx==0.3.2", "pyspark==3.5.0", "deltalake==0.13.0" ], @@ -162,7 +162,7 @@ def readme(): "redis": [ "jsonpath-rw==1.4.0", "jsonpath-rw-ext==1.2.2", - "redis==4.5.5", + "redis==5.0.1", "aioredis==2.0.1", "hiredis==2.2.3", "objectpath==0.6.1", @@ -175,26 +175,26 @@ def readme(): "psycopg-binary>=3.1.8", ], "postgresql": [ - "asyncpg==0.28.0", + "asyncpg==0.29.0", ], "mysql": [ "asyncmy==0.2.7", "mysqlclient==2.1.1" ], "mariadb": [ - "aiomysql==0.1.1" + "aiomysql==0.2.0" ], "boto3": [ - "botocore==1.29.76", - "aiobotocore==2.5.0", - "aioboto3==11.2.0" + "botocore==1.31.64", + "aiobotocore==2.7.0", + "aioboto3==12.0.0" ], "cassandra": [ "cassandra-driver==3.28.0", ], "influxdb": [ "influxdb==5.3.1", - "influxdb-client[async]==1.36.1", + "influxdb-client[async]==1.39.0", ], "odbc": [ "aioodbc==0.3.3", @@ -234,15 +234,15 @@ def readme(): "dask==2023.3.0", "python-datatable==1.1.3", "polars==0.19.12", - "pyarrow==13.0.0", - "connectorx==0.3.1", + "pyarrow==14.0.1", + "connectorx==0.3.2", "aiosqlite>=0.18.0", "pylibmc==1.6.3", "aiomcache==0.8.1", "jsonpath-rw==1.4.0", "jsonpath-rw-ext==1.2.2", "aioredis==2.0.1", - "redis==4.5.5", + "redis==5.0.1", "objectpath==0.6.1", "rethinkdb==2.4.9", "aiopg==1.4.0", @@ -261,15 +261,15 @@ def readme(): "aiocouch==2.2.2", "asyncmy==0.2.7", "mysqlclient==2.1.1", - "aiomysql==0.1.1", + "aiomysql==0.2.0", "pyspark==3.5.0", "oracledb==1.2.2", "hazelcast-python-client==5.3.0", "duckdb==0.8.1", "deltalake==0.13.0", - "botocore==1.29.76", - "aiobotocore==2.5.0", - "aioboto3==11.2.0", + "botocore==1.31.64", + "aiobotocore==2.7.0", + "aioboto3==12.0.0", "acsylla==0.1.8b0", ] }, diff --git a/tests/test_asyncpg.py b/tests/test_asyncpg.py index 51df9b19..73917bae 100644 --- a/tests/test_asyncpg.py +++ b/tests/test_asyncpg.py @@ -11,13 +11,13 @@ from asyncdb.meta import Record, Recordset DRIVER = 'pg' -DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator_dev" +DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator" PARAMS = { "host": '127.0.0.1', "port": '5432', "user": 'troc_pgdata', "password": '12345678', - "database": 'navigator_dev' + "database": 'navigator' } diff --git a/tests/test_basic.py b/tests/test_basic.py index 0671c511..ecc40ea7 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -13,7 +13,7 @@ def driver(): @pytest.fixture() def dsn(): - return "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator_dev" + return "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator" @pytest.fixture() @@ -23,7 +23,7 @@ def params(): "port": '5432', "user": 'troc_pgdata', "password": '12345678', - "database": 'navigator_dev' + "database": 'navigator' } diff --git a/tests/test_dataclasses.py b/tests/test_dataclasses.py index 484bff87..02889e83 100644 --- a/tests/test_dataclasses.py +++ b/tests/test_dataclasses.py @@ -15,9 +15,9 @@ 'password': '12345678', 'host': 'localhost', 'port': '5432', - 'database': 'navigator_dev', + 'database': 'navigator', } -DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator_dev" +DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator" @pytest_asyncio.fixture diff --git a/tests/test_influx.py b/tests/test_influx.py index 769cb47e..4cbc06af 100644 --- a/tests/test_influx.py +++ b/tests/test_influx.py @@ -19,7 +19,7 @@ def params(): "host": "127.0.0.1", "port": "8086", "database": 'navigator', - "token": "qroJLmcrjM-IsDhxz-nR_NIoUxpjAgDz9AuXJJlTnikCIr70CNa_IxXlO5BID4LVrpHHCjzzeSr_UZab5ON_9A==", + "token": "FL2XDVzRheR9-apXJu0csK3HaBSjfEG3d15R9uIu8xG8WwL9ICAGyrPWLoPct4IHtacpjtKd1y3NbYbAFPs20g==", "user": "troc_pgdata", "password": "12345678", "org": "navigator" diff --git a/tests/test_model.py b/tests/test_model.py index ca3c53d4..5afe8756 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -20,7 +20,7 @@ async def db(): "password": "12345678", "host": "127.0.0.1", "port": "5432", - "database": "navigator_dev", + "database": "navigator", "DEBUG": True, } driver = AsyncDB("pg", params=params) diff --git a/tests/test_postgres.py b/tests/test_postgres.py index b0cacc77..66b5e378 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -8,13 +8,13 @@ from asyncdb.meta import Record, Recordset DRIVER = 'postgres' -DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator_dev" +DSN = "postgres://troc_pgdata:12345678@127.0.0.1:5432/navigator" params = { "host": '127.0.0.1', "port": '5432', "user": 'troc_pgdata', "password": '12345678', - "database": 'navigator_dev' + "database": 'navigator' } @@ -61,7 +61,7 @@ async def test_pool_connect(): pytest.assume(not error) pytest.assume(row[0] == 1) prepared, error = await db.prepare("SELECT store_id, store_name FROM walmart.stores") - pytest.assume(db.get_columns() == ["store_id", "store_name"]) + # pytest.assume(db.get_columns() == ["store_id", "store_name"]) assert not error db.disconnect() assert (not db.get_connection())