diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eb2fe1c..fec1b1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3.10 + python: python3.11 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 @@ -14,11 +14,7 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - id: trailing-whitespace -- repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - repo: https://github.com/myint/docformatter - rev: v1.5.1 + rev: v1.7.5 hooks: - id: docformatter diff --git a/HISTORY.rst b/HISTORY.rst index 2141072..8d16e82 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,12 @@ History ======= +v0.18.4 (2023-07-21) + +* Replace cchardet with faust-cchardet. +* Update cython==0.29.36. +* Update dominodatalab==1.2.4. + v0.18.3 (2023-06-07) * Add excel sheet filter to file ingestion efi functions. diff --git a/Makefile b/Makefile index 707e1b6..015d9cb 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ clean: install: . env/bin/activate; \ - pip install cython==0.29.35; \ pip install -r aioradio/requirements.txt setup: diff --git a/aioradio/aws/moto_server.py b/aioradio/aws/moto_server.py index 4b6db1c..a3b5120 100644 --- a/aioradio/aws/moto_server.py +++ b/aioradio/aws/moto_server.py @@ -1,4 +1,4 @@ -"""moto server for pytesting aws services.""" +"""Moto server for pytesting aws services.""" # pylint: disable=broad-exception-raised # pylint: disable=too-many-instance-attributes diff --git a/aioradio/aws/utils.py b/aioradio/aws/utils.py index d092d3c..3204de3 100644 --- a/aioradio/aws/utils.py +++ b/aioradio/aws/utils.py @@ -1,4 +1,3 @@ - """Generic async utility functions.""" # pylint: disable=broad-except diff --git a/aioradio/logger.py b/aioradio/logger.py index 653548d..417be23 100644 --- a/aioradio/logger.py +++ b/aioradio/logger.py @@ -15,7 +15,7 @@ class CustomJsonFormatter(jsonlogger.JsonFormatter): """Custom Json Formatter.""" def add_fields(self, log_record: Dict[str, Any], record: logging.LogRecord, message_dict: Dict[str, Any]): - """normalize default set of fields. + """Normalize default set of fields. Args: log_record (Dict[str, Any]): dict object containing log record info diff --git a/aioradio/redis.py b/aioradio/redis.py index 4bfcaa7..66f17b5 100644 --- a/aioradio/redis.py +++ b/aioradio/redis.py @@ -1,4 +1,4 @@ -"""aioradio redis cache script.""" +"""Aioradio redis cache script.""" # pylint: disable=c-extension-no-member # pylint: disable=no-member @@ -30,7 +30,7 @@ @dataclass class Redis: - """class dealing with redis functions.""" + """Class dealing with redis functions.""" config: Dict[str, Any] = dataclass_field(default_factory=dict) pool: redis.Redis = dataclass_field(init=False, repr=False) @@ -411,7 +411,7 @@ async def hexists(self, key: str, field: str) -> bool: return self.pool.hexists(key, field) async def build_cache_key(self, payload: Dict[str, Any], separator='|', use_hashkey: bool=None) -> str: - """build a cache key from a dictionary object. Concatenate and + """Build a cache key from a dictionary object. Concatenate and normalize key-values from an unnested dict, taking care of sorting the keys and each of their values (if a list). diff --git a/aioradio/requirements.txt b/aioradio/requirements.txt index 46cbc0c..f77568d 100644 --- a/aioradio/requirements.txt +++ b/aioradio/requirements.txt @@ -3,10 +3,11 @@ aiojobs==1.1.0 backoff==2.2.1 boto3==1.24.59 botocore==1.27.59 -cchardet==2.1.7 +cython==0.29.36 ddtrace==1.11.2 -dominodatalab==1.2.3 +dominodatalab==1.2.4 fakeredis==1.10.1 +faust-cchardet==2.1.18 flask==2.1.2 flask-cors==3.0.10 httpx==0.24.0 @@ -14,15 +15,15 @@ mandrill==1.0.60 moto==3.1.18 openpyxl==3.0.10 orjson==3.8.10 -pandas==2.0.0 -pre-commit==3.2.2 +pandas==2.0.3 +pre-commit==3.3.3 psycopg2-binary==2.9.6 -pylint==2.17.2 -pyodbc==4.0.39 +pylint==2.17.4 +pyodbc==4.0.39 --no-binary=pyodbc pysmb==1.2.9.1 -pytest==7.3.1 -pytest-asyncio==0.21.0 -pytest-cov==4.0.0 +pytest==7.4.0 +pytest-asyncio==0.21.1 +pytest-cov==4.1.0 python-json-logger==2.0.7 redis==3.5.3 twine==4.0.2 diff --git a/aioradio/tests/aws_secrets_test.py b/aioradio/tests/aws_secrets_test.py index 9b3a3a3..94aa66b 100644 --- a/aioradio/tests/aws_secrets_test.py +++ b/aioradio/tests/aws_secrets_test.py @@ -1,4 +1,4 @@ -"""pytest secrets.""" +"""Pytest secrets.""" # pylint: disable=unused-argument diff --git a/aioradio/tests/dynamodb_test.py b/aioradio/tests/dynamodb_test.py index 39ba6cd..ac6045f 100644 --- a/aioradio/tests/dynamodb_test.py +++ b/aioradio/tests/dynamodb_test.py @@ -1,4 +1,4 @@ -"""pytest dynamodb.""" +"""Pytest dynamodb.""" from decimal import Decimal from random import randint diff --git a/aioradio/tests/file_ingestion_test.py b/aioradio/tests/file_ingestion_test.py index 3a441d8..c905989 100644 --- a/aioradio/tests/file_ingestion_test.py +++ b/aioradio/tests/file_ingestion_test.py @@ -1,4 +1,4 @@ -"""pytest file_ingestion script.""" +"""Pytest file_ingestion script.""" # pylint: disable=broad-except # pylint: disable=c-extension-no-member diff --git a/aioradio/tests/jira_test.py b/aioradio/tests/jira_test.py index 82ea030..c3695cf 100644 --- a/aioradio/tests/jira_test.py +++ b/aioradio/tests/jira_test.py @@ -1,4 +1,4 @@ -"""pytest Jira.""" +"""Pytest Jira.""" # pylint: disable=c-extension-no-member diff --git a/aioradio/tests/logger_test.py b/aioradio/tests/logger_test.py index c99db98..ed694be 100644 --- a/aioradio/tests/logger_test.py +++ b/aioradio/tests/logger_test.py @@ -1,4 +1,4 @@ -"""pytest logger.""" +"""Pytest logger.""" import logging diff --git a/aioradio/tests/long_running_jobs_test.py b/aioradio/tests/long_running_jobs_test.py index 76cd170..89caded 100644 --- a/aioradio/tests/long_running_jobs_test.py +++ b/aioradio/tests/long_running_jobs_test.py @@ -1,4 +1,4 @@ -"""pytest Long Running Jobs.""" +"""Pytest Long Running Jobs.""" from asyncio import create_task, sleep from random import randint diff --git a/aioradio/tests/psycopg2_test.py b/aioradio/tests/psycopg2_test.py index c79c4a9..8929d5e 100644 --- a/aioradio/tests/psycopg2_test.py +++ b/aioradio/tests/psycopg2_test.py @@ -1,4 +1,4 @@ -"""pytest psycopg2 script.""" +"""Pytest psycopg2 script.""" import pytest diff --git a/aioradio/tests/pyodbc_test.py b/aioradio/tests/pyodbc_test.py index a98dbf6..d2b2664 100644 --- a/aioradio/tests/pyodbc_test.py +++ b/aioradio/tests/pyodbc_test.py @@ -1,4 +1,4 @@ -"""pytest pyodbc script.""" +"""Pytest pyodbc script.""" import pytest diff --git a/aioradio/tests/redis_test.py b/aioradio/tests/redis_test.py index 8543d00..60c1113 100644 --- a/aioradio/tests/redis_test.py +++ b/aioradio/tests/redis_test.py @@ -1,4 +1,4 @@ -"""pytest redis cache.""" +"""Pytest redis cache.""" # pylint: disable=c-extension-no-member diff --git a/aioradio/tests/s3_test.py b/aioradio/tests/s3_test.py index fad87b8..2b06307 100644 --- a/aioradio/tests/s3_test.py +++ b/aioradio/tests/s3_test.py @@ -1,4 +1,4 @@ -"""pytest s3.""" +"""Pytest s3.""" # pylint: disable=logging-fstring-interpolation diff --git a/aioradio/tests/sqs_test.py b/aioradio/tests/sqs_test.py index b8d5edf..3a82cd5 100644 --- a/aioradio/tests/sqs_test.py +++ b/aioradio/tests/sqs_test.py @@ -1,4 +1,4 @@ -"""pytest sqs.""" +"""Pytest sqs.""" # pylint: disable=c-extension-no-member # pylint: disable=no-member diff --git a/aioradio/utils.py b/aioradio/utils.py index ccbf72e..2fb18be 100644 --- a/aioradio/utils.py +++ b/aioradio/utils.py @@ -1,4 +1,4 @@ -"""aioradio utils cache script.""" +"""Aioradio utils cache script.""" # pylint: disable=ungrouped-imports # pylint: disable=wrong-import-position diff --git a/conftest.py b/conftest.py index 0c40ddf..ad6bc75 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,4 @@ -"""pytest configuration.""" +"""Pytest configuration.""" import asyncio import os diff --git a/setup.py b/setup.py index b552241..20d155d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ long_description = fileobj.read() setup(name='aioradio', - version='0.18.3', + version='0.18.4', description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more', long_description=long_description, long_description_content_type="text/markdown", @@ -26,9 +26,9 @@ 'backoff>=2.1.2', 'botocore==1.27.59', 'boto3==1.24.59', - #'cchardet>=2.1.7', + 'faust-cchardet>=2.1.18', 'ddtrace>=0.60.1', - 'dominodatalab>=1.1.1', + 'dominodatalab>=1.2.3', 'fakeredis>=1.7.1', 'httpx>=0.23.0', 'mandrill>=1.0.60',