uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
75
pkgs/development/python-modules/graphene-django/default.nix
Normal file
75
pkgs/development/python-modules/graphene-django/default.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
|
||||
, graphene
|
||||
, graphql-core
|
||||
, django
|
||||
, djangorestframework
|
||||
, promise
|
||||
, text-unidecode
|
||||
|
||||
, django-filter
|
||||
, mock
|
||||
, pytest-django
|
||||
, pytest-random-order
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "graphene-django";
|
||||
version = "unstable-2022-03-03";
|
||||
format = "setuptools";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "graphql-python";
|
||||
repo = pname;
|
||||
rev = "f6ec0689c18929344c79ae363d2e3d5628fa4a2d";
|
||||
hash = "sha256-KTZ5jcoeHYXnlaF47t8jIi6+7NyMyA4hDPv+il3bt+U=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./graphene-3_2_0.patch
|
||||
(fetchpatch {
|
||||
url = "https://github.com/graphql-python/graphene-django/commit/ca555293a4334c26cf9a390dd1e3d0bd4c819a17.patch";
|
||||
excludes = [ "setup.py" ];
|
||||
sha256 = "sha256-RxG1MRhmpBKnHhSg4SV+DjZ3uA0nl9oUeei56xjtUpw=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace '"pytest-runner"' ""
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
djangorestframework
|
||||
graphene
|
||||
graphql-core
|
||||
django
|
||||
promise
|
||||
text-unidecode
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export DJANGO_SETTINGS_MODULE=examples.django_test_settings
|
||||
'';
|
||||
|
||||
checkInputs = [
|
||||
django-filter
|
||||
mock
|
||||
pytest-django
|
||||
pytest-random-order
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Integrate GraphQL into your Django project";
|
||||
homepage = "https://github.com/graphql-python/graphene-django";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
diff --git a/graphene_django/filter/tests/test_fields.py b/graphene_django/filter/tests/test_fields.py
|
||||
index 7d440f4..0aec6e4 100644
|
||||
--- a/graphene_django/filter/tests/test_fields.py
|
||||
+++ b/graphene_django/filter/tests/test_fields.py
|
||||
@@ -1005,7 +1005,7 @@ def test_integer_field_filter_type():
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pets(offset: Int = null, before: String = null, after: String = null, first: Int = null, last: Int = null, age: Int = null): PetTypeConnection
|
||||
@@ -1074,7 +1074,7 @@ def test_other_filter_types():
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pets(offset: Int = null, before: String = null, after: String = null, first: Int = null, last: Int = null, age: Int = null, age_Isnull: Boolean = null, age_Lt: Int = null): PetTypeConnection
|
||||
diff --git a/graphene_django/tests/test_command.py b/graphene_django/tests/test_command.py
|
||||
index 70116b8..a4ab4db 100644
|
||||
--- a/graphene_django/tests/test_command.py
|
||||
+++ b/graphene_django/tests/test_command.py
|
||||
@@ -49,7 +49,7 @@ def test_generate_graphql_file_on_call_graphql_schema():
|
||||
assert handle.write.called_once()
|
||||
|
||||
schema_output = handle.write.call_args[0][0]
|
||||
- assert schema_output == dedent(
|
||||
+ assert schema_output.rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
hi: String
|
||||
diff --git a/graphene_django/tests/test_types.py b/graphene_django/tests/test_types.py
|
||||
index bde72c7..0b64440 100644
|
||||
--- a/graphene_django/tests/test_types.py
|
||||
+++ b/graphene_django/tests/test_types.py
|
||||
@@ -247,7 +247,7 @@ def test_schema_representation():
|
||||
}
|
||||
"""
|
||||
)
|
||||
- assert str(schema) == expected
|
||||
+ assert str(schema).rstrip() + "\n" == expected
|
||||
|
||||
|
||||
def with_local_registry(func):
|
||||
@@ -515,7 +515,7 @@ class TestDjangoObjectType:
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pet: Pet
|
||||
@@ -541,7 +541,7 @@ class TestDjangoObjectType:
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pet: Pet
|
||||
@@ -576,7 +576,7 @@ class TestDjangoObjectType:
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pet: Pet
|
||||
@@ -603,7 +603,7 @@ class TestDjangoObjectType:
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pet: PetModelKind
|
||||
@@ -642,7 +642,7 @@ class TestDjangoObjectType:
|
||||
|
||||
schema = Schema(query=Query)
|
||||
|
||||
- assert str(schema) == dedent(
|
||||
+ assert str(schema).rstrip() + "\n" == dedent(
|
||||
"""\
|
||||
type Query {
|
||||
pet: PetModelKind
|
||||
diff --git a/graphene_django/tests/test_views.py b/graphene_django/tests/test_views.py
|
||||
index 945fa87..e2e8b46 100644
|
||||
--- a/graphene_django/tests/test_views.py
|
||||
+++ b/graphene_django/tests/test_views.py
|
||||
@@ -109,12 +109,10 @@ def test_reports_validation_errors(client):
|
||||
{
|
||||
"message": "Cannot query field 'unknownOne' on type 'QueryRoot'.",
|
||||
"locations": [{"line": 1, "column": 9}],
|
||||
- "path": None,
|
||||
},
|
||||
{
|
||||
"message": "Cannot query field 'unknownTwo' on type 'QueryRoot'.",
|
||||
"locations": [{"line": 1, "column": 21}],
|
||||
- "path": None,
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -135,8 +133,6 @@ def test_errors_when_missing_operation_name(client):
|
||||
"errors": [
|
||||
{
|
||||
"message": "Must provide operation name if query contains multiple operations.",
|
||||
- "locations": None,
|
||||
- "path": None,
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -476,8 +472,7 @@ def test_handles_syntax_errors_caught_by_graphql(client):
|
||||
"errors": [
|
||||
{
|
||||
"locations": [{"column": 1, "line": 1}],
|
||||
- "message": "Syntax Error: Unexpected Name 'syntaxerror'.",
|
||||
- "path": None,
|
||||
+ "message": "Syntax Error: Unexpected Name 'syntaxerror'."
|
||||
}
|
||||
]
|
||||
}
|
||||
diff --git a/graphene_django/views.py b/graphene_django/views.py
|
||||
index c23b020..f533f70 100644
|
||||
--- a/graphene_django/views.py
|
||||
+++ b/graphene_django/views.py
|
||||
@@ -11,7 +11,6 @@ from django.views.decorators.csrf import ensure_csrf_cookie
|
||||
from django.views.generic import View
|
||||
from graphql import OperationType, get_operation_ast, parse, validate
|
||||
from graphql.error import GraphQLError
|
||||
-from graphql.error import format_error as format_graphql_error
|
||||
from graphql.execution import ExecutionResult
|
||||
|
||||
from graphene import Schema
|
||||
@@ -387,7 +386,7 @@ class GraphQLView(View):
|
||||
@staticmethod
|
||||
def format_error(error):
|
||||
if isinstance(error, GraphQLError):
|
||||
- return format_graphql_error(error)
|
||||
+ return error.formatted
|
||||
|
||||
return {"message": str(error)}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue