class substrafl.dependency.Dependency(*, editable_mode: bool = False, pypi_dependencies: List[str] = None, local_dependencies: List[pathlib.PosixPath] = None, local_code: List[pathlib.PosixPath] = None)

Bases: pydantic.main.BaseModel

Dependency pydantic class.


If you are using your current package as a local dependencies, be aware that folders named local-worker or with tmp_substrafl as prefix are ignored during the installation.

  • editable_mode (bool) – If set to False, substra, substrafl and substratools used in the Dockerfiles submitted to Substra platform will be taken from owkin pypi. Be sure to have access to owkin’s pypi and configure accordingly your pip.conf. If set to True, it will be the one installed in editable mode from your python environment. Defaults to False.

  • dependencies (List[str]) – Python packages installable from pypi.

  • local_dependencies (List[pathlib.Path]) – Local installable packages. The command pip install -e . will be executed in each of those folders hence a must be present in each folder.

  • local_code (List[pathlib.Path]) – Local relative imports used by your script. All files / folders must be at the same level than your script.

  • pypi_dependencies (List[str]) –

Return type


Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

classmethod check_setup(v)

Check the presence of a file in the provided paths.

classmethod resolve_path(v)

Resolve list of local code paths and check if they exist.