Skip to content

Commit

Permalink
Merge pull request #16 from EverWinter23/graphene-3.0.0
Browse files Browse the repository at this point in the history
draft: Bump graphene deps to v3b

Closes #15
  • Loading branch information
EverWinter23 committed Feb 28, 2022
2 parents 4a42bbe + 245290e commit ac54354
Show file tree
Hide file tree
Showing 7 changed files with 446 additions and 13 deletions.
24 changes: 24 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
black = "==19.3b0"
coverage = "==4.5.4"
coveralls = "==1.8.2"
flake8 = "==3.7.8"
graphene = "==3.0.0"
graphene-django = "==3.0.0b7"
graphql-core = "==3.1.2"
pytest = "==5.1.2"
pytest-cov = "==2.7.1"
pytest-django = "==3.5.1"
psycopg2 = "==2.8.3"
Django = "==2.2.13"
graphene-gis = {path = "."}

[dev-packages]

[requires]
python_version = "3.7"
397 changes: 397 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ $ twine upload dist/*

### UPDATE

Targeting graphene-v3 update by March'22.
- [x] Targeting graphene-v3 update by March'22 -> [MR](https://github.com/EverWinter23/graphene-gis/pull/16)

### LICENSE [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Expand Down
2 changes: 1 addition & 1 deletion graphene_gis/scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def serialize(geometry):

@classmethod
def parse_literal(cls, node):
assert isinstance(node, ast.StringValue)
assert isinstance(node, ast.StringValueNode)
geometry = GEOSGeometry(node.value)
return json.loads(geometry.geojson)

Expand Down
20 changes: 16 additions & 4 deletions graphene_gis/tests/test_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

def test_should_mutate_gis_scalar_using_parse_literal():
class PointModelType(graphene.ObjectType):
location = graphene.Field(graphene.String, to=scalars.PointScalar())
location = graphene.Field(graphene.JSONString, to=scalars.PointScalar())

class Query(graphene.ObjectType):
hello_world = graphene.String()

def resolve_hello_world(self, info):
return "hello, world!"

class CreatePointModelType(graphene.Mutation):
point = graphene.Field(PointModelType)
Expand All @@ -20,7 +26,7 @@ def mutate(root, info, location):
class TestMutation(graphene.ObjectType):
create_point = CreatePointModelType.Field()

schema = graphene.Schema(mutation=TestMutation)
schema = graphene.Schema(query=Query, mutation=TestMutation)

query = """
mutation {
Expand All @@ -34,7 +40,7 @@ class TestMutation(graphene.ObjectType):

expected = {
"createPoint": {
"point": {"location": "{'type': 'Point', 'coordinates': [3.0, 5.0]}"}
"point": {"location": '{"type": "Point", "coordinates": [3.0, 5.0]}'}
}
}

Expand All @@ -53,6 +59,12 @@ def test_should_mutate_json_scalar_using_parse_literal():
class JSONModelType(graphene.ObjectType):
props = graphene.Field(graphene.JSONString, to=scalars.JSONScalar())

class Query(graphene.ObjectType):
hello_world = graphene.String()

def resolve_hello_world(self, info):
return "hello, world!"

class JSONMutation(graphene.Mutation):
json = graphene.Field(JSONModelType)

Expand All @@ -66,7 +78,7 @@ def mutate(root, info, props):
class Mutation(graphene.ObjectType):
create_json = JSONMutation.Field()

schema = graphene.Schema(mutation=Mutation)
schema = graphene.Schema(query=Query, mutation=Mutation)

mutation = """
mutation JSONMutation{
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ black==19.3b0
coverage==4.5.4
coveralls==1.8.2
flake8==3.7.8
graphene==2.1.8
graphene-django==2.5.0
graphql-core==2.2.1
graphene==3.0.0b1
graphene-django==3.0.0b1
graphql-core==3.1
pytest==5.1.2
pytest-cov==2.7.1
pytest-django==3.5.1
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="graphene-gis",
version="0.0.7",
version="0.0.8b",
description="GIS support for graphene-django",
long_description_content_type='text/markdown',
url="https://github.com/EverWinter23/graphene-gis",
Expand All @@ -26,9 +26,9 @@
author="Rishabh Mehta",
author_email="eternal.blizzard23@gmail.com",
install_requires=[
"graphene>=2.1,<3",
"graphene-django>=2.5,<3",
"graphql-core>=2.1,<3",
"graphene>=3.0.0,<4",
"graphene-django>=3.0.0b7,<4",
"graphql-core>=3.1.2,<4",
],

setup_requires=["pytest-runner"],
Expand Down

0 comments on commit ac54354

Please sign in to comment.