ci: update pyupgrade

This commit is contained in:
Ankush Menat 2023-07-14 14:23:11 +05:30
parent fefd9ac2e2
commit adf30693a9
17 changed files with 27 additions and 17 deletions

View file

@ -21,7 +21,7 @@ repos:
- id: debug-statements - id: debug-statements
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.34.0 rev: v3.9.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: ['--py310-plus'] args: ['--py310-plus']

View file

@ -19,7 +19,8 @@ import os
import re import re
import unicodedata import unicodedata
import warnings import warnings
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, TypeAlias, overload from collections.abc import Callable
from typing import TYPE_CHECKING, Any, Literal, Optional, TypeAlias, overload
import click import click
from werkzeug.local import Local, release_local from werkzeug.local import Local, release_local

View file

@ -1,7 +1,8 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE # License: MIT. See LICENSE
from collections.abc import Sequence
from datetime import timedelta from datetime import timedelta
from typing import Optional, Sequence from typing import Optional
import frappe import frappe
import frappe.defaults import frappe.defaults

View file

@ -8,9 +8,10 @@ import random
import re import re
import string import string
import traceback import traceback
from collections.abc import Iterable, Sequence
from contextlib import contextmanager, suppress from contextlib import contextmanager, suppress
from time import time from time import time
from typing import Any, Iterable, Sequence from typing import Any
from pypika.dialects import MySQLQueryBuilder, PostgreSQLQueryBuilder from pypika.dialects import MySQLQueryBuilder, PostgreSQLQueryBuilder
from pypika.terms import Criterion, NullValue from pypika.terms import Criterion, NullValue

View file

@ -2,7 +2,7 @@
# MIT License. See license.txt # MIT License. See license.txt
import operator import operator
from typing import Callable from collections.abc import Callable
import frappe import frappe
from frappe.database.utils import NestedSetHierarchy from frappe.database.utils import NestedSetHierarchy

View file

@ -3,7 +3,8 @@
import hashlib import hashlib
import json import json
import time import time
from typing import Any, Generator, Iterable from collections.abc import Generator, Iterable
from typing import Any
from werkzeug.exceptions import NotFound from werkzeug.exceptions import NotFound

View file

@ -3,7 +3,8 @@
import datetime import datetime
import re import re
from typing import TYPE_CHECKING, Callable, Optional from collections.abc import Callable
from typing import TYPE_CHECKING, Optional
import frappe import frappe
from frappe import _ from frappe import _

View file

@ -1,6 +1,7 @@
from collections.abc import Callable
from enum import Enum from enum import Enum
from importlib import import_module from importlib import import_module
from typing import Any, Callable, get_type_hints from typing import Any, get_type_hints
from pypika.queries import Column, QueryBuilder from pypika.queries import Column, QueryBuilder
from pypika.terms import PseudoColumn from pypika.terms import PseudoColumn

View file

@ -1,9 +1,9 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE # License: MIT. See LICENSE
from collections.abc import Callable
from datetime import datetime from datetime import datetime
from functools import wraps from functools import wraps
from typing import Callable
from werkzeug.wrappers import Response from werkzeug.wrappers import Response

View file

@ -7,7 +7,7 @@ import json
import re import re
import time import time
from collections import Counter from collections import Counter
from typing import Callable from collections.abc import Callable
import sqlparse import sqlparse

View file

@ -1,4 +1,4 @@
from typing import Callable from collections.abc import Callable
import frappe import frappe
from frappe.model import child_table_fields from frappe.model import child_table_fields

View file

@ -2,8 +2,8 @@ import copy
import datetime import datetime
import signal import signal
import unittest import unittest
from collections.abc import Sequence
from contextlib import contextmanager from contextlib import contextmanager
from typing import Sequence
import frappe import frappe
from frappe.model.base_document import BaseDocument from frappe.model.base_document import BaseDocument

View file

@ -11,6 +11,7 @@ import sys
import traceback import traceback
from collections import deque from collections import deque
from collections.abc import ( from collections.abc import (
Callable,
Container, Container,
Generator, Generator,
Iterable, Iterable,
@ -20,7 +21,7 @@ from collections.abc import (
) )
from email.header import decode_header, make_header from email.header import decode_header, make_header
from email.utils import formataddr, parseaddr from email.utils import formataddr, parseaddr
from typing import Any, Callable, Literal from typing import Any, Literal
from urllib.parse import quote, urlparse from urllib.parse import quote, urlparse
from redis.exceptions import ConnectionError from redis.exceptions import ConnectionError

View file

@ -3,8 +3,9 @@ import os
import socket import socket
import time import time
from collections import defaultdict from collections import defaultdict
from collections.abc import Callable
from functools import lru_cache from functools import lru_cache
from typing import Any, Callable, NoReturn from typing import Any, NoReturn
from uuid import uuid4 from uuid import uuid4
import redis import redis

View file

@ -3,9 +3,9 @@
import json import json
from collections import defaultdict from collections import defaultdict
from collections.abc import Callable
from datetime import datetime, timedelta from datetime import datetime, timedelta
from functools import wraps from functools import wraps
from typing import Callable
import frappe import frappe

View file

@ -3,7 +3,8 @@
import base64 import base64
import json import json
from typing import TYPE_CHECKING, Callable from collections.abc import Callable
from typing import TYPE_CHECKING
import frappe import frappe
import frappe.utils import frappe.utils

View file

@ -1,7 +1,8 @@
from collections.abc import Callable
from functools import lru_cache, wraps from functools import lru_cache, wraps
from inspect import _empty, isclass, signature from inspect import _empty, isclass, signature
from types import EllipsisType from types import EllipsisType
from typing import Callable, ForwardRef, TypeVar, Union from typing import ForwardRef, TypeVar, Union
from frappe.exceptions import FrappeTypeError from frappe.exceptions import FrappeTypeError