File tree Expand file tree Collapse file tree
runtime/bk-plugin-runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " bk-plugin-framework"
3- version = " 2.3.0rc2 "
3+ version = " 2.3.0rc3 "
44description = " bk plugin python framework"
55authors = [" Your Name <you@example.com>" ]
66license = " MIT"
@@ -10,7 +10,7 @@ python = "^3.8.0,<4.0"
1010pydantic = " >=1.0,<3"
1111werkzeug = " >=2.0.0, <4.0"
1212apigw-manager = {version = " >=1.0.6, <4" , extras = [" extra" ]}
13- bk-plugin-runtime = " 2.1.0rc2 "
13+ bk-plugin-runtime = " 2.1.0rc3 "
1414jsonschema = " >=2.5.0,<5.0.0"
1515
1616[tool .poetry .dev-dependencies ]
Original file line number Diff line number Diff line change 1010specific language governing permissions and limitations under the License.
1111"""
1212
13- __version__ = "2.1.0rc2 "
13+ __version__ = "2.1.0rc3 "
Original file line number Diff line number Diff line change 1818
1919# This will make sure the app is always imported when
2020# Django starts so that shared_task will use this app.
21+ import django
2122from blueapps .core .celery import celery_app
23+ from django .utils .functional import cached_property
24+ from django .db .backends .mysql .features import DatabaseFeatures
2225
2326# app 基本信息
2427
@@ -47,3 +50,20 @@ def get_env_or_raise(key):
4750
4851# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4952BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
53+
54+ # 兼容低版本 MySQL
55+ class PatchFeatures :
56+ @cached_property
57+ def minimum_database_version (self ):
58+ django_version = django .VERSION
59+ if self .connection .mysql_is_mariadb :
60+ return 10 , 4
61+ elif django_version < (4 , 0 ):
62+ import pymysql
63+ pymysql .install_as_MySQLdb ()
64+ return 5 , 7
65+ else :
66+ return 8 , 0
67+
68+ # 目前 Django 仅是对 5.7 做了软性的不兼容改动,在没有使用 8.0 特异的功能时,对 5.7 版本的使用无影响
69+ DatabaseFeatures .minimum_database_version = PatchFeatures .minimum_database_version
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " bk-plugin-runtime"
3- version = " 2.1.0rc2 "
3+ version = " 2.1.0rc3 "
44description = " bk plugin python django runtime"
55authors = [" Your Name <you@example.com>" ]
66license = " MIT"
77
88[tool .poetry .dependencies ]
99python = " ^3.8.0,<4.0"
1010redis = " >=2.10.5,<6"
11- Django = " ^4.2 "
11+ Django = " >=2.2.6,<5 "
1212pymysql = " >=1,<2"
1313gunicorn = " >=19.6.0"
1414djangorestframework = " ^3.15"
You can’t perform that action at this time.
0 commit comments