Skip to content

Commit

Permalink
feat: 依赖包升级(closed #2160)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalice-1831 committed Jan 3, 2025
1 parent ad70bb8 commit fa511cb
Show file tree
Hide file tree
Showing 246 changed files with 700 additions and 544 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
name: black
language: python
- repo: https://github.com/pycqa/isort
rev: 5.5.4
rev: 5.12.0
hooks:
- id: isort
args: [ "--profile", "black" ]
Expand Down
2 changes: 1 addition & 1 deletion apps/adapters/api/gse/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
specific language governing permissions and limitations under the License.
"""
import typing
from collections import Mapping
from collections.abc import Mapping

from apps.node_man import constants, models
from apps.utils import basic
Expand Down
2 changes: 1 addition & 1 deletion apps/adapters/api/gse/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""
import logging
import typing
from collections import Mapping
from collections.abc import Mapping

from django.conf import settings

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/agent/artifact_builder/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import typing

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend import exceptions
from apps.backend.agent.config_parser import GseConfigParser
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/agent/artifact_builder/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import tarfile
import typing

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.node_man import constants

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/agent/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Any, Dict, List

from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from apps.backend.components.collections.agent_new import components
from apps.node_man.constants import NodeType
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/agent/solution_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
symmetric_cipher_manager,
)
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api import constants as backend_api_constants
from apps.backend.subscription.steps.agent_adapter.base import AgentSetupInfo
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class OS(object):
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

import os

from celery import Celery, platforms
from celery import Celery
from django.conf import settings

# http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#running-the-worker-with-superuser-privileges-root
# for root start celery

platforms.C_FORCE_ROOT = True
os.environ.setdefault("C_FORCE_ROOT", "true")

# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from django.conf import settings
from django.db import transaction
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.core.concurrent import controller
from apps.node_man import constants, models, tools
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/agent_new/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from typing import Any, Dict, List, Match, Optional, Set, Tuple, Union

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.agent.tools import (
InstallationTools,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union

from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.core.concurrent import controller
from apps.node_man import models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from typing import Set

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.node_man import constants, models

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from typing import Any, Dict, List, Optional, Union

from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.node_man import constants, models
from env.constants import GseVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections import defaultdict
from typing import Any, Dict, List, Optional, Set

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend import constants as backend_constants
from apps.backend.agent.tools import get_cloud_id__proxies_map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
specific language governing permissions and limitations under the License.
"""

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from pipeline.component_framework.component import Component

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
specific language governing permissions and limitations under the License.
"""

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api.constants import POLLING_INTERVAL
from apps.backend.components.collections.agent_new.base import AgentBaseService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from collections import defaultdict
from typing import Dict, List, Optional, Set, Union

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api.constants import POLLING_INTERVAL
from apps.node_man import constants, models
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/agent_new/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from django.conf import settings
from django.utils import timezone, translation
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from redis.client import Pipeline

from apps.backend.agent import solution_maker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Any, Dict, List

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api.constants import POLLING_INTERVAL
from apps.core.concurrent.retry import RetryHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""
from typing import Any, Dict, List, Optional

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api.constants import POLLING_INTERVAL
from apps.core.concurrent import controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from typing import Any, Dict, List, Optional, Union

from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.core.concurrent import controller
from apps.node_man import constants, models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from django.conf import settings
from django.db import transaction
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.subscription import tools
from apps.component.esbclient import client_v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Dict, List, Optional, Set, Union

from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.core.concurrent import controller
from apps.node_man import models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from typing import List

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.node_man import constants
from apps.node_man.models import Host, ProcessStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from typing import Dict, List, Optional, Union

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base import AgentBaseService, AgentCommonData

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/agent_new/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import time

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from pipeline.core.flow import Service, StaticIntervalGenerator

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from django.db.models import Value
from django.db.models.functions import Concat
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from apps.adapters.api.gse import GseApiBaseHelper, get_gse_api_helper
from apps.backend.api.constants import POLLING_TIMEOUT
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/common/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from collections import ChainMap, defaultdict
from enum import Enum

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend import constants as backend_constants
from apps.core.concurrent import controller
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from enum import Enum
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.core.concurrent import core_concurrent_constants
from apps.node_man import constants, models
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import six
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.backend.api.constants import POLLING_INTERVAL
from apps.backend.api.job import process_parms
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from django.db import IntegrityError
from django.db.models import F, Q
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from apps.backend.api.constants import (
GSE_RUNNING_TASK_CODE,
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/components/collections/subsubscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from apps.backend.api.constants import (
POLLING_INTERVAL,
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/components/task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
from celery.task import task
from celery import current_app

from pipeline.service import task_service


@task(ignore_result=True)
@current_app.task(ignore_result=True)
def callback(*args, **kwargs):
task_service.callback(*args, **kwargs)
2 changes: 1 addition & 1 deletion apps/backend/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import Dict

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.utils import basic, enum

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from apps.exceptions import AppBaseException

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/healthz/checker/celery_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import random

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from common.log import logger

Expand Down
14 changes: 7 additions & 7 deletions apps/backend/healthz/checker/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from django.core import signals
from django.db import connections
from six.moves import zip

from apps.backend.healthz.constants import CheckerStatus
from common.log import logger
Expand All @@ -38,12 +37,13 @@ def __init__(self, name, checker, safe=False):
def _get_func_args_decl(self, func, skip=0):
args = []
kwargs = {}
argspec = inspect.getargspec(func)
iargs = iter(argspec.args[::-1])
if argspec.defaults:
defaults = argspec.defaults[::-1]
kwargs.update((k, v) for v, k in zip(defaults, iargs))
args.extend(iargs)
sig = inspect.signature(func)
params = sig.parameters
for name, param in params.items():
if param.default == param.empty:
args.append(name)
else:
kwargs[name] = param.default
return args[:-skip], kwargs

def get_argspec(self):
Expand Down
3 changes: 1 addition & 2 deletions apps/backend/healthz/checker/supervisor_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
from subprocess import check_output

from django.conf import settings
from django.utils.translation import ugettext as _
from six.moves import zip
from django.utils.translation import gettext as _

from common.log import logger

Expand Down
Loading

0 comments on commit fa511cb

Please sign in to comment.