deps#

deps(spec, include_test_deps=False)[source]#

Get PEP 440 dependency requirements for a craft spec.

The deps utility returns a PEP 440 compatible requirement string required to construct the deserialization via craft.

In case the spec includes estimators with disjunctions in their requirement specifications, the first disjunctive requirement is returned, i.e., any disjunctions are resolved by picking the first dependency in the disjunction.

Parameters:
specstr, sktime/skbase compatible object specification

i.e., a string that executes to construct an object if all imports were present. imports inferred are of any classes in the scope of all_estimators

  • option 1: a string that evaluates to an estimator

  • option 2: a sequence of assignments in valid python code, with the object to be defined preceded by a “return”. assignments can use names of classes as if all imports were present

include_test_depsbool, default=False

whether to include dependencies tagged as “tests:python_dependencies” in addition to “python_dependencies”

Returns:
reqslist of str

each str is PEP 440 compatible requirement string for craft(spec) if spec has no requirements, return is [], the length 0 list