bkpaas-python-sdk
bkpaas-python-sdk copied to clipboard
蓝鲸 PaaS 平台 Python 工具集
## 背景 目前蓝鲸环境中存在多个插件网关,当新系统接入插件服务时,需要拥有一个能够为新系统进行批量插件网关授权的管理应用账号
https://pypi.org/project/blue-krill/ https://pypi.org/project/bkstorages/ 两个项目页面过于简陋,开发者很难找到细节信息。 参考 [django setup.cfg](https://github.com/django/django/blob/main/setup.cfg) 修正当前 `setup.py` 的一些问题: - bkstorages 没有生成 rst,没法在主页显示 long_description - 没有 homepage 链接到 GitHub(还可以支持其他 project_urls) - 项目跟路径缺少 LICENSE - Python 版本限定需要更精确
https://www.djangoproject.com/weblog/2021/jun/02/security-releases/ 限定 Django > 2.2.24,>3.2.4
- 新增插件配置说明 - 优化使用文档
具体配置可以参考: https://github.com/TencentBlueKing/blueking-paas/blob/main/.pre-commit-config.yaml
## 环境版本: python3.6 Django==2.2.6 bkstorages==1.0.6 ## default.py设置: USE_TZ = True TIME_ZONE = 'Asia/Shanghai' LANGUAGE_CODE = 'zh-hans' ## 问题代码: from django.core.files.storage import default_storage modified_time = default_storage.get_modified_time(file_path) ## 报错信息: modified_time = default_storage.get_modified_time(file_path)\n...
如果pypi 中没有上传wheel,只有源码,那么安装的时候,会去build wheel, 此时会解析pyproject.toml,此时由于格式是老的导致安装失败 如果没有锁 setuptools 版本,那么升级之后,如果源 sdk 没有传wheel会导致第三方安装失败 - [pep 621](https://peps.python.org/pep-0621/) - [setuptools history](https://setuptools.pypa.io/en/latest/history.html#v61-0-0) / [Configuring setuptools using pyproject.toml files](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html) - poetry 2.0.0 已经支持 https://github.com/python-poetry/poetry/releases/tag/2.0.0 处理: 1. pyproject.toml 同时兼容新老?...
需要放开版本锁,然后单测确认 5.x 能跑通; 这个会影响使用到这个包的项目无法升级到 django 5.2.4
- urllib3 升级 ``` Using CPython 3.10.16 × No solution found when resolving dependencies: ╰─▶ Because your project depends on blue-krill==2.1.2 and blue-krill==2.1.2 depends on urllib3>=1.26.16,=1.26.16,=2 and apigateway-dashboard:dev depends on...