Fix passing filename in sdk.development.detect_with_pip_freeze

This commit is contained in:
allegroai 2022-07-15 16:21:35 +03:00
parent 9b551b6d40
commit b803fa5ae1

View File

@ -290,7 +290,12 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
if self._force_use_pip_freeze:
if isinstance(self._force_use_pip_freeze, (str, Path)):
conda_requirements = ''
req_file = Path(self._force_use_pip_freeze)
try:
req_file = Path(self._force_use_pip_freeze)
except TypeError:
# LazyEvaluator loading when casting
req_file = Path(str(self._force_use_pip_freeze))
requirements = req_file.read_text() if req_file.is_file() else None
else:
requirements, conda_requirements = pip_freeze(