File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
servers/mlflowserver/mlflowserver Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 77import argparse
88import json
99import yaml
10+ import re
1011import tempfile
1112from subprocess import run
1213from seldon_core .microservice import PARAMETERS_ENV_NAME , parse_parameters
@@ -78,7 +79,16 @@ def inject_base_reqs(env_file_path):
7879 for dep in conda_env ["dependencies" ]:
7980 if isinstance (dep , dict ) and "pip" in dep :
8081 pip_exists = True
81- dep ["pip" ].append (f"-r { BASE_REQS_PATH } " )
82+ r = re .compile ("=|>|<| " )
83+ package_list = [r .split (p )[0 ] for p in dep ["pip" ]]
84+ with open (BASE_REQS_PATH ) as f :
85+ for line in f :
86+ line = line .rstrip ()
87+ if not line or line .startswith ("#" ):
88+ continue
89+ package_name = r .split (line )[0 ]
90+ if package_name not in package_list :
91+ dep ["pip" ].append (line )
8292 break
8393 if not pip_exists :
8494 new_entry = {"pip" : [f"-r { BASE_REQS_PATH } " ]}
You can’t perform that action at this time.
0 commit comments