Skip to content

Commit

Permalink
Merge branch 'master' into pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
dulmandakh committed Jul 5, 2024
2 parents 1180c5e + dc3b2e4 commit 73c43b0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ repos:
- id: pyupgrade
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.10
rev: v0.5.0
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
7 changes: 0 additions & 7 deletions bin/autolinter

This file was deleted.

3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys

import sphinx_graphene_theme

Expand All @@ -22,8 +23,6 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath(".."))

Expand Down
2 changes: 1 addition & 1 deletion graphene/pyutils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ def get_git_changeset():
)
timestamp = git_log.communicate()[0]
timestamp = datetime.datetime.utcfromtimestamp(int(timestamp))
except:
except Exception:
return None
return timestamp.strftime("%Y%m%d%H%M%S")
2 changes: 1 addition & 1 deletion graphene/relay/id_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BaseGlobalIDType:
Base class that define the required attributes/method for a type.
"""

graphene_type = ID # type: Type[BaseType]
graphene_type: Type[BaseType] = ID

@classmethod
def resolve_global_id(cls, info, global_id):
Expand Down
1 change: 0 additions & 1 deletion graphene/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa
from graphql import GraphQLResolveInfo as ResolveInfo

from .argument import Argument
Expand Down
12 changes: 6 additions & 6 deletions graphene/types/base.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from typing import Type
from typing import Type, Optional

from ..utils.subclass_with_meta import SubclassWithMeta, SubclassWithMeta_Meta
from ..utils.trim_docstring import trim_docstring


class BaseOptions:
name = None # type: str
description = None # type: str
name: Optional[str] = None
description: Optional[str] = None

_frozen = False # type: bool
_frozen: bool = False

def __init__(self, class_type):
self.class_type = class_type # type: Type
def __init__(self, class_type: Type):
self.class_type: Type = class_type

def freeze(self):
self._frozen = True
Expand Down
3 changes: 1 addition & 2 deletions graphene/types/scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ class Float(Scalar):
"""

@staticmethod
def coerce_float(value):
# type: (Any) -> float
def coerce_float(value: Any) -> float:
try:
return float(value)
except ValueError:
Expand Down
4 changes: 2 additions & 2 deletions graphene/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from collections.abc import Iterable
from functools import partial

from typing import List # flake8: noqa
from typing import List

Loader = namedtuple("Loader", "key,future")

Expand Down Expand Up @@ -62,7 +62,7 @@ def __init__(
self.get_cache_key = get_cache_key or (lambda x: x)

self._cache = cache_map if cache_map is not None else {}
self._queue = [] # type: List[Loader]
self._queue: List[Loader] = []

@property
def loop(self):
Expand Down

0 comments on commit 73c43b0

Please sign in to comment.