Skip to content

Commit 6851c41

Browse files
Drop singledispatch (#234)
* drop singledispatch dependency * bump: graphene-mongo v0.4.3 --------- Co-authored-by: Ananthu C V <[email protected]>
1 parent 8f46790 commit 6851c41

File tree

8 files changed

+203
-240
lines changed

8 files changed

+203
-240
lines changed

Diff for: .github/workflows/ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ jobs:
2525
uses: actions/setup-python@v3
2626
with:
2727
python-version: ${{ matrix.python }}
28-
- name: Lint with ruff
29-
run: |
30-
python -m pip install ruff
31-
make lint
3228
- name: Install dependencies
3329
run: |
3430
python -m pip install poetry
3531
poetry config virtualenvs.create false
3632
poetry install --with dev
33+
- name: Lint with ruff
34+
run: make lint
3735
- name: Run Tests
3836
run: make test
3937
- name: Build Package

Diff for: .github/workflows/lint.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ jobs:
1919
uses: actions/setup-python@v3
2020
with:
2121
python-version: ${{ matrix.python }}
22-
- name: Lint with ruff
22+
- name: Install dependencies
2323
run: |
24-
python -m pip install ruff
25-
make lint
24+
python -m pip install poetry
25+
poetry config virtualenvs.create false
26+
poetry install --with dev
27+
- name: Lint with ruff
28+
run: make lint

Diff for: examples/django_mongoengine/bike_catalog/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
1617
from django.contrib import admin
1718
from django.urls import path, include
1819

Diff for: examples/django_mongoengine/manage.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
3+
34
import os
45
import sys
56

Diff for: graphene_mongo/converter.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99
from mongoengine.base import get_document, LazyReference
1010
from . import advanced_types
1111
from .utils import (
12-
import_single_dispatch,
1312
get_field_description,
1413
get_query_fields,
1514
ExecutorEnum,
1615
sync_to_async,
1716
)
1817
from concurrent.futures import ThreadPoolExecutor, as_completed
19-
20-
singledispatch = import_single_dispatch()
18+
from functools import singledispatch
2119

2220

2321
class MongoEngineConversionError(Exception):

Diff for: graphene_mongo/utils.py

-23
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,6 @@ def is_valid_mongoengine_model(model):
5555
)
5656

5757

58-
def import_single_dispatch():
59-
try:
60-
from functools import singledispatch
61-
except ImportError:
62-
singledispatch = None
63-
64-
if not singledispatch:
65-
try:
66-
from singledispatch import singledispatch
67-
except ImportError:
68-
pass
69-
70-
if not singledispatch:
71-
raise Exception(
72-
"It seems your python version does not include "
73-
"functools.singledispatch. Please install the 'singledispatch' "
74-
"package. More information here: "
75-
"https://pypi.python.org/pypi/singledispatch"
76-
)
77-
78-
return singledispatch
79-
80-
8158
# noqa
8259
def get_type_for_document(schema, document):
8360
types = schema.types.values()

Diff for: poetry.lock

+190-204
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "graphene-mongo"
33
packages = [{ include = "graphene_mongo" }]
4-
version = "0.4.2"
4+
version = "0.4.3"
55
description = "Graphene Mongoengine integration"
66
authors = [
77
"Abaw Chen <[email protected]>",
@@ -31,7 +31,6 @@ python = ">=3.8,<4"
3131
graphene = ">=3.1.1"
3232
promise = ">=2.3"
3333
mongoengine = ">=0.27"
34-
singledispatch = ">=4.1.0"
3534
asgiref = "^3.7.2"
3635

3736
[tool.poetry.group.dev.dependencies]
@@ -40,7 +39,7 @@ mongomock = ">=4.1.2"
4039
mock = ">=5.0.1"
4140
pytest-cov = "*"
4241
pytest-asyncio = "^0.21.0"
43-
ruff = "^0.1.6"
42+
ruff = "*"
4443
setuptools = "^69.0.2"
4544

4645

0 commit comments

Comments
 (0)