Skip to content

Commit

Permalink
feat: update dependencies for project
Browse files Browse the repository at this point in the history
  • Loading branch information
rolin999 committed Nov 15, 2024
1 parent 6a88fde commit fc3cf6f
Show file tree
Hide file tree
Showing 35 changed files with 1,270 additions and 1,251 deletions.
4 changes: 2 additions & 2 deletions src/bk-login/bklogin/common/error_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# to the current version of the project delivered to anyone in the future.
from http import HTTPStatus

from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _

from bklogin.utils.std_error import ErrorCode


class ErrorCodeCategoryEnum(str, StructuredEnum):
class ErrorCodeCategoryEnum(StrStructuredEnum):
# 400
INVALID_ARGUMENT = EnumField("INVALID_ARGUMENT", label=_("参数不符合格式"))
INVALID_REQUEST = EnumField("INVALID_REQUEST", label=_("参数符合格式但不符合业务规则"))
Expand Down
4 changes: 2 additions & 2 deletions src/bk-login/bklogin/component/bk_user/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _


class IdpStatus(str, StructuredEnum):
class IdpStatus(StrStructuredEnum):
"""认证源状态"""

ENABLED = EnumField("enabled", label=_("启用"))
Expand Down
4 changes: 2 additions & 2 deletions src/bk-login/bklogin/open_apis/compatibility/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum


class CompatibilityApiErrorCodeEnum(str, StructuredEnum):
class CompatibilityApiErrorCodeEnum(StrStructuredEnum):
"""兼容 API 错误码"""

SUCCESS = EnumField("SUCCESS")
Expand Down
282 changes: 140 additions & 142 deletions src/bk-login/poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/bk-login/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ priority = "default"
python = ">=3.11,<3.12"
django = "4.2.16"
pymysql = "1.1.1"
requests = "2.31.0"
gunicorn = "21.2.0"
gevent = "24.2.1"
requests = "2.32.3"
gunicorn = "23.0.0"
gevent = "24.10.3"
django-environ = "0.8.1"
whitenoise = "6.5.0"
werkzeug = "3.0.2"
Expand All @@ -40,12 +40,12 @@ opentelemetry-instrumentation-logging = "0.46b0"
bk-notice-sdk = "1.3.2"

[tool.poetry.group.dev.dependencies]
ruff = "^0.5.2"
mypy = "^1.10.1"
ruff = "0.7.1"
mypy = "1.13.0"
types-requests = "^2.31.0.2"
pytest = "^7.4.2"
pytest-django = "^4.5.2"
import-linter = "^1.11.1"
pytest = "8.3.3"
pytest-django = "4.9.0"
import-linter = "2.1"
types-pymysql = "^1.1.0.20240524"

[tool.mypy]
Expand Down
20 changes: 10 additions & 10 deletions src/bk-login/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ django-cors-headers==4.3.0 ; python_version >= "3.11" and python_version < "3.12
django-environ==0.8.1 ; python_version >= "3.11" and python_version < "3.12"
django-prometheus==2.3.1 ; python_version >= "3.11" and python_version < "3.12"
django==4.2.16 ; python_version >= "3.11" and python_version < "3.12"
gevent==24.2.1 ; python_version >= "3.11" and python_version < "3.12"
googleapis-common-protos==1.65.0 ; python_version >= "3.11" and python_version < "3.12"
greenlet==3.1.1 ; platform_python_implementation == "CPython" and python_version >= "3.11" and python_version < "3.12"
gevent==24.10.3 ; python_version >= "3.11" and python_version < "3.12"
googleapis-common-protos==1.66.0 ; python_version >= "3.11" and python_version < "3.12"
greenlet==3.1.1 ; python_version >= "3.11" and python_version < "3.12" and platform_python_implementation == "CPython"
grpcio==1.67.1 ; python_version >= "3.11" and python_version < "3.12"
gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "3.12"
gunicorn==23.0.0 ; python_version >= "3.11" and python_version < "3.12"
idna==3.10 ; python_version >= "3.11" and python_version < "3.12"
importlib-metadata==7.1.0 ; python_version >= "3.11" and python_version < "3.12"
markupsafe==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
Expand All @@ -45,7 +45,7 @@ opentelemetry-proto==1.25.0 ; python_version >= "3.11" and python_version < "3.1
opentelemetry-sdk==1.25.0 ; python_version >= "3.11" and python_version < "3.12"
opentelemetry-semantic-conventions==0.46b0 ; python_version >= "3.11" and python_version < "3.12"
opentelemetry-util-http==0.46b0 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.1 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.2 ; python_version >= "3.11" and python_version < "3.12"
portalocker==2.10.1 ; python_version >= "3.11" and python_version < "3.12"
prometheus-client==0.21.0 ; python_version >= "3.11" and python_version < "3.12"
protobuf==4.25.5 ; python_version >= "3.11" and python_version < "3.12"
Expand All @@ -58,20 +58,20 @@ pymysql==1.1.1 ; python_version >= "3.11" and python_version < "3.12"
python-editor==1.0.4 ; python_version >= "3.11" and python_version < "3.12"
python-json-logger==2.0.7 ; python_version >= "3.11" and python_version < "3.12"
pywin32==308 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows"
requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12"
requests==2.32.3 ; python_version >= "3.11" and python_version < "3.12"
sentry-sdk==1.43.0 ; python_version >= "3.11" and python_version < "3.12"
setuptools==75.3.0 ; python_version >= "3.11" and python_version < "3.12"
setuptools==75.5.0 ; python_version >= "3.11" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
sqlparse==0.5.1 ; python_version >= "3.11" and python_version < "3.12"
sqlparse==0.5.2 ; python_version >= "3.11" and python_version < "3.12"
toml==0.10.2 ; python_version >= "3.11" and python_version < "3.12"
tongsuopy-crayon==1.0.2b6 ; python_version >= "3.11" and python_version < "3.12"
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "3.12"
tzdata==2024.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
urllib3==1.26.20 ; python_version >= "3.11" and python_version < "3.12"
watchdog==5.0.3 ; python_version >= "3.11" and python_version < "3.12"
watchdog==6.0.0 ; python_version >= "3.11" and python_version < "3.12"
werkzeug==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
whitenoise==6.5.0 ; python_version >= "3.11" and python_version < "3.12"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
zipp==3.20.2 ; python_version >= "3.11" and python_version < "3.12"
zipp==3.21.0 ; python_version >= "3.11" and python_version < "3.12"
zope-event==5.0 ; python_version >= "3.11" and python_version < "3.12"
zope-interface==7.1.1 ; python_version >= "3.11" and python_version < "3.12"
28 changes: 14 additions & 14 deletions src/bk-login/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ django-cors-headers==4.3.0 ; python_version >= "3.11" and python_version < "3.12
django-environ==0.8.1 ; python_version >= "3.11" and python_version < "3.12"
django-prometheus==2.3.1 ; python_version >= "3.11" and python_version < "3.12"
django==4.2.16 ; python_version >= "3.11" and python_version < "3.12"
gevent==24.2.1 ; python_version >= "3.11" and python_version < "3.12"
googleapis-common-protos==1.65.0 ; python_version >= "3.11" and python_version < "3.12"
greenlet==3.1.1 ; platform_python_implementation == "CPython" and python_version >= "3.11" and python_version < "3.12"
gevent==24.10.3 ; python_version >= "3.11" and python_version < "3.12"
googleapis-common-protos==1.66.0 ; python_version >= "3.11" and python_version < "3.12"
greenlet==3.1.1 ; python_version >= "3.11" and python_version < "3.12" and platform_python_implementation == "CPython"
grimp==3.5 ; python_version >= "3.11" and python_version < "3.12"
grpcio==1.67.1 ; python_version >= "3.11" and python_version < "3.12"
gunicorn==21.2.0 ; python_version >= "3.11" and python_version < "3.12"
gunicorn==23.0.0 ; python_version >= "3.11" and python_version < "3.12"
idna==3.10 ; python_version >= "3.11" and python_version < "3.12"
import-linter==1.12.1 ; python_version >= "3.11" and python_version < "3.12"
import-linter==2.1 ; python_version >= "3.11" and python_version < "3.12"
importlib-metadata==7.1.0 ; python_version >= "3.11" and python_version < "3.12"
iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "3.12"
markupsafe==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
Expand All @@ -50,7 +50,7 @@ opentelemetry-proto==1.25.0 ; python_version >= "3.11" and python_version < "3.1
opentelemetry-sdk==1.25.0 ; python_version >= "3.11" and python_version < "3.12"
opentelemetry-semantic-conventions==0.46b0 ; python_version >= "3.11" and python_version < "3.12"
opentelemetry-util-http==0.46b0 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.1 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.2 ; python_version >= "3.11" and python_version < "3.12"
pluggy==1.5.0 ; python_version >= "3.11" and python_version < "3.12"
portalocker==2.10.1 ; python_version >= "3.11" and python_version < "3.12"
prometheus-client==0.21.0 ; python_version >= "3.11" and python_version < "3.12"
Expand All @@ -62,28 +62,28 @@ pydantic==2.6.4 ; python_version >= "3.11" and python_version < "3.12"
pyjwt==2.9.0 ; python_version >= "3.11" and python_version < "3.12"
pymysql==1.1.1 ; python_version >= "3.11" and python_version < "3.12"
pytest-django==4.9.0 ; python_version >= "3.11" and python_version < "3.12"
pytest==7.4.4 ; python_version >= "3.11" and python_version < "3.12"
pytest==8.3.3 ; python_version >= "3.11" and python_version < "3.12"
python-editor==1.0.4 ; python_version >= "3.11" and python_version < "3.12"
python-json-logger==2.0.7 ; python_version >= "3.11" and python_version < "3.12"
pywin32==308 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows"
requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12"
ruff==0.5.7 ; python_version >= "3.11" and python_version < "3.12"
requests==2.32.3 ; python_version >= "3.11" and python_version < "3.12"
ruff==0.7.1 ; python_version >= "3.11" and python_version < "3.12"
sentry-sdk==1.43.0 ; python_version >= "3.11" and python_version < "3.12"
setuptools==75.3.0 ; python_version >= "3.11" and python_version < "3.12"
setuptools==75.5.0 ; python_version >= "3.11" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
sqlparse==0.5.1 ; python_version >= "3.11" and python_version < "3.12"
sqlparse==0.5.2 ; python_version >= "3.11" and python_version < "3.12"
toml==0.10.2 ; python_version >= "3.11" and python_version < "3.12"
tongsuopy-crayon==1.0.2b6 ; python_version >= "3.11" and python_version < "3.12"
types-pymysql==1.1.0.20240524 ; python_version >= "3.11" and python_version < "3.12"
types-pymysql==1.1.0.20241103 ; python_version >= "3.11" and python_version < "3.12"
types-requests==2.31.0.6 ; python_version >= "3.11" and python_version < "3.12"
types-urllib3==1.26.25.14 ; python_version >= "3.11" and python_version < "3.12"
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "3.12"
tzdata==2024.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
urllib3==1.26.20 ; python_version >= "3.11" and python_version < "3.12"
watchdog==5.0.3 ; python_version >= "3.11" and python_version < "3.12"
watchdog==6.0.0 ; python_version >= "3.11" and python_version < "3.12"
werkzeug==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
whitenoise==6.5.0 ; python_version >= "3.11" and python_version < "3.12"
wrapt==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
zipp==3.20.2 ; python_version >= "3.11" and python_version < "3.12"
zipp==3.21.0 ; python_version >= "3.11" and python_version < "3.12"
zope-event==5.0 ; python_version >= "3.11" and python_version < "3.12"
zope-interface==7.1.1 ; python_version >= "3.11" and python_version < "3.12"
4 changes: 2 additions & 2 deletions src/bk-user/bkuser/apis/web/password/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _


class TokenRelatedObjType(str, StructuredEnum):
class TokenRelatedObjType(StrStructuredEnum):
"""令牌关联对象类型"""

TENANT_USER = EnumField("tenant_user", label=_("租户用户"))
Expand Down
6 changes: 3 additions & 3 deletions src/bk-user/bkuser/apis/web/personal_center/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _


class PersonalCenterFeatureFlag(str, StructuredEnum):
class PersonalCenterFeatureFlag(StrStructuredEnum):
"""
TODO:技术债,不使用 FeatureFlag 命名,需要统一 Review 调整
"""
Expand All @@ -29,7 +29,7 @@ class PersonalCenterFeatureFlag(str, StructuredEnum):
EMAIL_UPDATE_RESTRICTION = EnumField("email_update_restriction", label=_("邮箱更新限制"))


class PhoneOrEmailUpdateRestrictionEnum(str, StructuredEnum):
class PhoneOrEmailUpdateRestrictionEnum(StrStructuredEnum):
NEED_VERIFY = EnumField("need_verify", label=_("验证后修改"))
EDITABLE_DIRECTLY = EnumField("editable_directly", label=_("可直接修改"))
NOT_EDITABLE = EnumField("not_editable", label=_("不可修改"))
6 changes: 3 additions & 3 deletions src/bk-user/bkuser/apps/data_source/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _

from bkuser.plugins.local.constants import USERNAME_REGEX as DATA_SOURCE_USERNAME_REGEX # noqa: F401
Expand All @@ -23,14 +23,14 @@
USER_EXTRAS_UPDATE_BATCH_SIZE = 250


class FieldMappingOperation(str, StructuredEnum):
class FieldMappingOperation(StrStructuredEnum):
"""字段映射关系"""

DIRECT = EnumField("direct", label=_("直接"))
EXPRESSION = EnumField("expression", label=_("表达式"))


class DataSourceTypeEnum(str, StructuredEnum):
class DataSourceTypeEnum(StrStructuredEnum):
"""数据源类型"""

REAL = EnumField("real", label=_("实体"))
Expand Down
8 changes: 4 additions & 4 deletions src/bk-user/bkuser/apps/idp/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _


class IdpCategory(str, StructuredEnum):
class IdpCategory(StrStructuredEnum):
"""认证源分类"""

ENTERPRISE = EnumField("enterprise", label=_("企业"))
SOCIAL = EnumField("social", label=_("社交"))


class IdpStatus(str, StructuredEnum):
class IdpStatus(StrStructuredEnum):
"""认证源状态"""

ENABLED = EnumField("enabled", label=_("启用"))
DISABLED = EnumField("disabled", label=_("未启用"))


class AllowBindScopeObjectType(str, StructuredEnum):
class AllowBindScopeObjectType(StrStructuredEnum):
"""社会化认证源,允许绑定的范围对象类型"""

USER = EnumField("user", label=_("用户"))
Expand Down
6 changes: 3 additions & 3 deletions src/bk-user/bkuser/apps/notification/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _


class NotificationMethod(str, StructuredEnum):
class NotificationMethod(StrStructuredEnum):
"""通知方式"""

EMAIL = EnumField("email", label=_("邮件"))
SMS = EnumField("sms", label=_("短信"))


class NotificationScene(str, StructuredEnum):
class NotificationScene(StrStructuredEnum):
"""通知场景"""

USER_INITIALIZE = EnumField("user_initialize", label=_("用户初始化"))
Expand Down
6 changes: 3 additions & 3 deletions src/bk-user/bkuser/apps/permission/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
# to the current version of the project delivered to anyone in the future.
import logging

from blue_krill.data_types.enum import EnumField, StructuredEnum
from blue_krill.data_types.enum import EnumField, StrStructuredEnum
from django.utils.translation import gettext_lazy as _

logger = logging.getLogger(__name__)


class UserRole(str, StructuredEnum):
class UserRole(StrStructuredEnum):
"""用户角色"""

SUPER_MANAGER = EnumField("super_manager", label=_("超级管理员"))
TENANT_MANAGER = EnumField("tenant_manager", label=_("租户管理员"))
NATURAL_USER = EnumField("natural_user", label=_("普通用户"))


class PermAction(str, StructuredEnum):
class PermAction(StrStructuredEnum):
"""权限行为"""

# TODO (su) 接入 IAM 时,需要评估是否细化 Action
Expand Down
Loading

0 comments on commit fc3cf6f

Please sign in to comment.