Skip to content

Commit

Permalink
Graphene v3 following v3 graphql-core (#1048)
Browse files Browse the repository at this point in the history
* v3.0 - remove Python 2.x from build (#983)

* Change travis to only compile for p3.6+

* Changed tox to only run Python 3.6+

* Changed library classifiers to reflect support in Python 3.6+

* Changed version to 3.0.0 development

In [15]: get_version((3, 0, 0, "alpha", 0))
Out[15]: '3.0.dev20190601212304'

* Reorganize Tests (#985)

We no longer need a dedicated folder for Python3.6+ tests
We no longer need to check six.PY3 in tests

* Upgrade black to 19.3b0 (#987)

* Remove six dependency (#986)

* No one is using func_name

* Remove six simple usages

* Remove six requirement

* Remove `six.with_metaclass` calls

* pytest-asyncio should be a regular dependency now with Py3 move

* Change dependency to graphql-core-next (#988)

* Changed dependencies to core-next

* Converted Scalars

* ResolveInfo name change

* Ignore .venv

* Make Schema compatible with GraphQL-core-next

* Ignore more venv names and mypy and pytest caches

* Remove print statements for debugging in schema test

* core-next now provides out_type and out_name

* Adapt date and time scalar types to core-next

* Ignore the non-standard result.invalid flag

* Results are named tuples in core-next (immutable)

* Enum values are returned as dict in core-next

* Fix mutation tests with promises

* Make all 345 tests pass with graphql-core-next

* Remove the compat module which was only needed for older Py version

* Remove object as base class (not needed in Py 3)

* We can assume that dicts are ordered in Py 3.6+

* Make use of the fact that dicts are iterable

* Use consistent style of importing from pytest

* Restore compatibility with graphql-relay-py v3

Add adpaters for the PageInfo and Connection args.

* Avoid various deprecation warnings

* Use graphql-core 3 instead of graphql-core-next

* Update dependencies, reformat changes with black

* Update graphene/relay/connection.py

Co-Authored-By: Jonathan Kim <[email protected]>

* Run black on setup.py

* Remove trailing whitespace
  • Loading branch information
mvanlonden authored Aug 17, 2019
1 parent 3d0e460 commit 8e7d76b
Show file tree
Hide file tree
Showing 73 changed files with 1,117 additions and 2,036 deletions.
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ __pycache__/

# Distribution / packaging
.Python
env/
venv/
.venv/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -47,7 +44,8 @@ htmlcov/
.pytest_cache
nosetests.xml
coverage.xml
*,cover
*.cover
.pytest_cache/

# Translations
*.mo
Expand All @@ -62,6 +60,14 @@ docs/_build/
# PyBuilder
target/

# VirtualEnv
.env
.venv
env/
venv/

# Typing
.mypy_cache/

/tests/django.sqlite

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ repos:
hooks:
- id: pyupgrade
- repo: https://github.com/ambv/black
rev: 18.9b0
rev: 19.3b0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 3.7.7
rev: 3.7.8
hooks:
- id: flake8
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: python
dist: xenial

python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@

snapshots[
"test_str_schema 1"
] = """schema {
query: Query
mutation: Mutation
}
] = '''"""A faction in the Star Wars saga"""
type Faction implements Node {
"""The ID of the object"""
id: ID!
"""The name of the faction."""
name: String
ships(before: String, after: String, first: Int, last: Int): ShipConnection
"""The ships used by the faction."""
ships(before: String = null, after: String = null, first: Int = null, last: Int = null): ShipConnection
}
input IntroduceShipInput {
shipName: String!
factionId: String!
clientMutationId: String
clientMutationId: String = null
}
type IntroduceShipPayload {
Expand All @@ -57,35 +58,60 @@
introduceShip(input: IntroduceShipInput!): IntroduceShipPayload
}
"""An object with an ID"""
interface Node {
"""The ID of the object"""
id: ID!
}
"""
The Relay compliant `PageInfo` type, containing data necessary to paginate this connection.
"""
type PageInfo {
"""When paginating forwards, are there more items?"""
hasNextPage: Boolean!
"""When paginating backwards, are there more items?"""
hasPreviousPage: Boolean!
"""When paginating backwards, the cursor to continue."""
startCursor: String
"""When paginating forwards, the cursor to continue."""
endCursor: String
}
type Query {
rebels: Faction
empire: Faction
"""The ID of the object"""
node(id: ID!): Node
}
"""A ship in the Star Wars saga"""
type Ship implements Node {
"""The ID of the object"""
id: ID!
"""The name of the ship."""
name: String
}
type ShipConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!
"""Contains the nodes in this connection."""
edges: [ShipEdge]!
}
"""A Relay edge containing a `Ship` and its cursor."""
type ShipEdge {
"""The item at the end of the edge"""
node: Ship
"""A cursor for use in pagination"""
cursor: String!
}
"""
'''
3 changes: 2 additions & 1 deletion graphene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from .utils.module_loading import lazy_import


VERSION = (2, 1, 8, "final", 0)
VERSION = (3, 0, 0, "alpha", 0)


__version__ = get_version(VERSION)

Expand Down
21 changes: 0 additions & 21 deletions graphene/pyutils/compat.py

This file was deleted.

Loading

0 comments on commit 8e7d76b

Please sign in to comment.