From 607953167829e2ef1f929384b271a8cbe9050a11 Mon Sep 17 00:00:00 2001 From: Ananthu C V Date: Tue, 5 Mar 2024 01:32:17 +0530 Subject: [PATCH 1/2] drop singledispatch package dependency --- graphene_mongo/converter.py | 4 +--- graphene_mongo/utils.py | 23 ----------------------- poetry.lock | 15 --------------- pyproject.toml | 1 - 4 files changed, 1 insertion(+), 42 deletions(-) diff --git a/graphene_mongo/converter.py b/graphene_mongo/converter.py index 7bed391..e81fee2 100644 --- a/graphene_mongo/converter.py +++ b/graphene_mongo/converter.py @@ -9,15 +9,13 @@ from mongoengine.base import get_document, LazyReference from . import advanced_types from .utils import ( - import_single_dispatch, get_field_description, get_query_fields, ExecutorEnum, sync_to_async, ) from concurrent.futures import ThreadPoolExecutor, as_completed - -singledispatch = import_single_dispatch() +from functools import singledispatch class MongoEngineConversionError(Exception): diff --git a/graphene_mongo/utils.py b/graphene_mongo/utils.py index 87699b6..165d02a 100644 --- a/graphene_mongo/utils.py +++ b/graphene_mongo/utils.py @@ -55,29 +55,6 @@ def is_valid_mongoengine_model(model): ) -def import_single_dispatch(): - try: - from functools import singledispatch - except ImportError: - singledispatch = None - - if not singledispatch: - try: - from singledispatch import singledispatch - except ImportError: - pass - - if not singledispatch: - raise Exception( - "It seems your python version does not include " - "functools.singledispatch. Please install the 'singledispatch' " - "package. More information here: " - "https://pypi.python.org/pypi/singledispatch" - ) - - return singledispatch - - # noqa def get_type_for_document(schema, document): types = schema.types.values() diff --git a/poetry.lock b/poetry.lock index 606b4ac..313a1da 100644 --- a/poetry.lock +++ b/poetry.lock @@ -498,21 +498,6 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] -[[package]] -name = "singledispatch" -version = "4.1.0" -description = "Backport functools.singledispatch to older Pythons." -optional = false -python-versions = ">=3.8" -files = [ - {file = "singledispatch-4.1.0-py2.py3-none-any.whl", hash = "sha256:6061bd291204beaeac90cdbc342b68d213b7a6efb44ae6c5e6422a78be351c8a"}, - {file = "singledispatch-4.1.0.tar.gz", hash = "sha256:f3430b886d5b4213d07d715096a75da5e4a8105284c497b9aee6d6d48bfe90cb"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-ruff"] - [[package]] name = "six" version = "1.16.0" diff --git a/pyproject.toml b/pyproject.toml index 13d8935..372f73e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ python = ">=3.8,<4" graphene = ">=3.1.1" promise = ">=2.3" mongoengine = ">=0.27" -singledispatch = ">=4.1.0" asgiref = "^3.7.2" [tool.poetry.group.dev.dependencies] From a7ebbd9a47476064b69c27440b98cc985307991f Mon Sep 17 00:00:00 2001 From: Ananthu C V Date: Fri, 8 Mar 2024 15:02:58 +0530 Subject: [PATCH 2/2] chore: bump version (patch) --- graphene_mongo/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphene_mongo/__init__.py b/graphene_mongo/__init__.py index 27e2594..59bab4d 100644 --- a/graphene_mongo/__init__.py +++ b/graphene_mongo/__init__.py @@ -3,7 +3,7 @@ from .types import MongoengineInputType, MongoengineInterfaceType, MongoengineObjectType from .types_async import AsyncMongoengineObjectType -__version__ = "0.4.2" +__version__ = "0.4.3" __all__ = [ "__version__", diff --git a/pyproject.toml b/pyproject.toml index 372f73e..63fe8de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "graphene-mongo" packages = [{ include = "graphene_mongo" }] -version = "0.4.2" +version = "0.4.3" description = "Graphene Mongoengine integration" authors = [ "Abaw Chen ",