Skip to content

Commit 3106c6e

Browse files
author
Julien Nakache
committed
revert lint
1 parent 174ed5f commit 3106c6e

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ repos:
77
- id: check-merge-conflict
88
- id: check-yaml
99
- id: debug-statements
10-
- id: end-of-file-fixer
11-
exclude: ^docs/.*$
12-
# TODO Enable in its own PR
13-
# - id: trailing-whitespace
14-
# exclude: README.md
15-
- repo: git://github.com/PyCQA/flake8
16-
rev: 88caf5ac484f5c09aedc02167c59c66ff0af0068 # 3.7.7
17-
hooks:
18-
- id: flake8
10+
# TDOO Enable in separate PR
11+
# - id: end-of-file-fixer
12+
# exclude: ^docs/.*$
13+
# - id: trailing-whitespace
14+
# exclude: README.md
15+
# - repo: git://github.com/PyCQA/flake8
16+
# rev: 88caf5ac484f5c09aedc02167c59c66ff0af0068 # 3.7.7
17+
# hooks:
18+
# - id: flake8

examples/nameko_sqlalchemy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ Now the following command will setup the database, and start the server:
5151

5252
Now head on over to postman and send POST request to:
5353
[http://127.0.0.1:5000/graphql](http://127.0.0.1:5000/graphql)
54-
and run some queries!
54+
and run some queries!

examples/nameko_sqlalchemy/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def parse_body(self,request):
3333
elif content_type in ('application/x-www-form-urlencoded', 'multipart/form-data'):
3434
return request.form
3535

36-
return {}
36+
return {}

examples/nameko_sqlalchemy/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
WEB_SERVER_ADDRESS: '0.0.0.0:5000'
1+
WEB_SERVER_ADDRESS: '0.0.0.0:5000'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
graphene[sqlalchemy]
22
SQLAlchemy==1.0.11
33
nameko
4-
graphql-server-core
4+
graphql-server-core

examples/nameko_sqlalchemy/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
echo "Starting application service server"
33
# Run Service
4-
nameko run --config config.yml service
4+
nameko run --config config.yml service

examples/nameko_sqlalchemy/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ class DepartmentService:
88

99
@http('POST', '/graphql')
1010
def query(self, request):
11-
return App().query(request)
11+
return App().query(request)

graphene_sqlalchemy/tests/test_converter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Test(Base):
168168
)
169169

170170
graphene_type = convert_sqlalchemy_column(Test.column)
171-
assert not graphene_type.kwargs["required"]
171+
assert graphene_type.kwargs["required"] == False
172172

173173

174174
def test_should_scalar_list_convert_list():
@@ -343,3 +343,4 @@ def __init__(self, col1, col2):
343343
)
344344

345345
assert "Don't know how to convert the composite field" in str(excinfo.value)
346+

graphene_sqlalchemy/tests/test_query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,4 @@ def makeNodes(nodeList):
555555
assert set(node["node"]["name"] for node in value["edges"]) == set(
556556
node["node"]["name"] for node in expectedNoSort[key]["edges"]
557557
)
558+

graphene_sqlalchemy/tests/test_reflected.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ def test_objecttype_registered():
1818
assert issubclass(Reflected, ObjectType)
1919
assert Reflected._meta.model == ReflectedEditor
2020
assert list(Reflected._meta.fields.keys()) == ["editor_id", "name"]
21+

graphene_sqlalchemy/tests/test_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ class Meta:
4747
model = Reporter
4848
only_fields = ("id", "email")
4949
assert list(Reporter2._meta.fields.keys()) == ["id", "email"]
50+

graphene_sqlalchemy/tests/test_types.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import OrderedDict
22
from graphene import Field, Int, Interface, ObjectType
33
from graphene.relay import Node, is_node, Connection
4-
import six # noqa: F401
4+
import six
55
from promise import Promise
66

77
from ..registry import Registry
@@ -176,9 +176,7 @@ class TestConnection(Connection):
176176
class Meta:
177177
node = ReporterWithCustomOptions
178178

179-
def resolver(*args, **kwargs):
180-
return Promise.resolve([])
181-
179+
resolver = lambda *args, **kwargs: Promise.resolve([])
182180
result = SQLAlchemyConnectionField.connection_resolver(
183181
resolver, TestConnection, ReporterWithCustomOptions, None, None
184182
)

graphene_sqlalchemy/types.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from collections import OrderedDict
22

3-
import sqlalchemy
43
from sqlalchemy.inspection import inspect as sqlalchemyinspect
54
from sqlalchemy.ext.hybrid import hybrid_property
65
from sqlalchemy.orm.exc import NoResultFound
76

8-
import graphene
97
from graphene import Field # , annotate, ResolveInfo
108
from graphene.relay import Connection, Node
119
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
@@ -82,9 +80,9 @@ def construct_fields(model, registry, only_fields, exclude_fields):
8280

8381

8482
class SQLAlchemyObjectTypeOptions(ObjectTypeOptions):
85-
model = None # type: sqlalchemy.Model
86-
registry = None # type: sqlalchemy.Registry
87-
connection = None # type: graphene.Type[Connection]
83+
model = None # type: Model
84+
registry = None # type: Registry
85+
connection = None # type: Type[Connection]
8886
id = None # type: str
8987

9088

0 commit comments

Comments
 (0)