diff --git a/python-graphene-django-no-mock.patch b/python-graphene-django-no-mock.patch new file mode 100644 index 0000000..e19325b --- /dev/null +++ b/python-graphene-django-no-mock.patch @@ -0,0 +1,48 @@ +diff -upr graphene-django-3.0.0b7.orig/graphene_django/tests/test_command.py graphene-django-3.0.0b7/graphene_django/tests/test_command.py +--- graphene-django-3.0.0b7.orig/graphene_django/tests/test_command.py 2022-05-12 12:06:48.134471409 +0200 ++++ graphene-django-3.0.0b7/graphene_django/tests/test_command.py 2022-05-12 12:06:48.150471511 +0200 +@@ -2,7 +2,7 @@ from textwrap import dedent + + from django.core import management + from io import StringIO +-from mock import mock_open, patch ++from unittest.mock import mock_open, patch + + from graphene import ObjectType, Schema, String + +diff -upr graphene-django-3.0.0b7.orig/graphene_django/tests/test_types.py graphene-django-3.0.0b7/graphene_django/tests/test_types.py +--- graphene-django-3.0.0b7.orig/graphene_django/tests/test_types.py 2022-05-12 12:06:48.134471409 +0200 ++++ graphene-django-3.0.0b7/graphene_django/tests/test_types.py 2022-05-12 12:06:48.150471511 +0200 +@@ -3,7 +3,7 @@ from textwrap import dedent + + import pytest + from django.db import models +-from mock import patch ++from unittest.mock import patch + + from graphene import Connection, Field, Interface, ObjectType, Schema, String + from graphene.relay import Node +diff -upr graphene-django-3.0.0b7.orig/graphene_django/tests/test_utils.py graphene-django-3.0.0b7/graphene_django/tests/test_utils.py +--- graphene-django-3.0.0b7.orig/graphene_django/tests/test_utils.py 2022-05-12 12:06:48.134471409 +0200 ++++ graphene-django-3.0.0b7/graphene_django/tests/test_utils.py 2022-05-12 12:06:48.150471511 +0200 +@@ -2,7 +2,7 @@ import json + + import pytest + from django.utils.translation import gettext_lazy +-from mock import patch ++from unittest.mock import patch + + from ..utils import camelize, get_model_fields, GraphQLTestCase + from .models import Film, Reporter +diff -upr graphene-django-3.0.0b7.orig/graphene_django/tests/test_views.py graphene-django-3.0.0b7/graphene_django/tests/test_views.py +--- graphene-django-3.0.0b7.orig/graphene_django/tests/test_views.py 2022-05-12 12:06:48.134471409 +0200 ++++ graphene-django-3.0.0b7/graphene_django/tests/test_views.py 2022-05-12 12:06:48.150471511 +0200 +@@ -2,7 +2,7 @@ import json + + import pytest + +-from mock import patch ++from unittest.mock import patch + + from django.db import connection + diff --git a/python-graphene-django.changes b/python-graphene-django.changes index 2eea693..49c6a93 100644 --- a/python-graphene-django.changes +++ b/python-graphene-django.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu May 12 10:10:00 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/graphql-python/graphene-django/issues/1321 + + python-graphene-django-no-mock.patch + ------------------------------------------------------------------- Tue Jan 11 10:45:59 UTC 2022 - John Vandenberg diff --git a/python-graphene-django.spec b/python-graphene-django.spec index d18c0dd..7975885 100644 --- a/python-graphene-django.spec +++ b/python-graphene-django.spec @@ -26,6 +26,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/graphql-python/graphene-django Source: https://github.com/graphql-python/graphene-django/archive/v%{version}.tar.gz#/graphene-django-%{version}.tar.gz +# https://github.com/graphql-python/graphene-django/issues/1321 +Patch0: python-graphene-django-no-mock.patch BuildRequires: %{python_module django-codemod} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -48,7 +50,6 @@ BuildRequires: %{python_module djangorestframework >= 3.6.3} BuildRequires: %{python_module graphene >= 2.9.9} BuildRequires: %{python_module graphql-core >= 3.1.0} BuildRequires: %{python_module graphql-relay} -BuildRequires: %{python_module mock} BuildRequires: %{python_module promise >= 2.1} BuildRequires: %{python_module psycopg2} BuildRequires: %{python_module pytest-django >= 3.3.2} @@ -62,6 +63,7 @@ Graphene Django integration. %prep %setup -q -n graphene-django-%{version} +%patch0 -p1 rm setup.cfg sed -i '/pytest-runner/d' setup.py