Skip to content

Commit 084bc8a

Browse files
committed
fix: 修改oss插件的依赖版本
1 parent 69124c9 commit 084bc8a

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

Pipfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
flask = "==1.0.2"
8-
flask-sqlalchemy = "==2.3.2"
9-
flask-wtf = "==0.14.2"
107
cymysql = "==0.9.1"
11-
flask-cors = "==2.1.0"
128
requests = "==2.18.4"
139
pipfile = "*"
14-
lin-cms = "==0.1.1a4"
10+
oss2 = "==2.6.1"
11+
Flask = "==1.0.2"
12+
Flask-SQLAlchemy = "==2.3.2"
13+
Flask-WTF = "==0.14.2"
14+
Flask-Cors = "==2.1.0"
15+
Lin-CMS = "==0.1.1a4"
1516

1617
[dev-packages]
1718
pytest = "*"
1819

1920
[requires]
20-
python_version = "3.6"
21+
python_version = "3.6"

app/plugins/oss/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
oss2=="*"
1+
oss2==2.6.1

plugin_init.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def generate_path(self):
4444
else:
4545
names = self.name.split(" ")
4646
for name in names:
47-
exit('插件名称不能为空,请重试') if self.name == '' else print('正在初始化插件' + name + '...')
47+
if self.name == '':
48+
exit('插件名称不能为空,请重试')
4849
self.path_info[name] = {
4950
'plugin_path': self.plugin_path + '.' + name,
5051
'plugin_config_path': self.plugin_path + '.' + name + '.config',
@@ -58,6 +59,7 @@ def auto_install_rely(self):
5859
raise Exception('安装插件依赖时发生错误!\nError:' + str(e))
5960
from subprocess import CalledProcessError
6061
for name in self.path_info:
62+
print('正在初始化插件' + name + '...')
6163
filename = 'requirements.txt'
6264
file_path = self.app.config.root_path + '/plugins/' + name + '/' + filename
6365
success_msg = '安装' + name + '插件的依赖成功'
@@ -280,9 +282,9 @@ def __generate_plugin_graph(self):
280282

281283
def __check_top_dependencies(self, top_package):
282284
for plugin_package in self.plugin_graph:
283-
# top_version = top_package['installed_version']
284-
# plugin_version = plugin_package['version']
285-
if top_package['key'] == plugin_package['package']['key']:
285+
top_version = top_package['installed_version']
286+
plugin_version = plugin_package['package']['version']
287+
if top_package['key'] == plugin_package['package']['key'] and top_version != plugin_version:
286288
err_msg = '由于项目主目录已经存在在包' \
287289
'' + top_package['package_name'] + ',但 ' + plugin_package['package']['plugin_name']\
288290
+ ' 插件尝试重复安装不同版本,请尝试手动去掉该插件的requirements.txt中的包'

0 commit comments

Comments
 (0)