resolve_import_path

Resolves a given path based on the repository structure to the working directory. Good for determining the path of imports and such.

Arguments

Name
Type
Description
Required

path_to_resolve

string

The path to resolve based on the repository structure.

reference_path

string

The path to use as the reference for resolution. Likely the path to the file where the path to resolve is used.

preferred_extensions

array

List of preferred file extensions to check for the path to resolve.

Returns

Type
Description

string

The resolved path relative to the working directory.

Example

- name: resolve_import_path
  arguments:
    path_to_resolve: <the-path-to-resolve>
    reference_path: <the-reference-path-to-help-with-resolution>
    preferred_extensions: ['.py', '.txt']
  returns: <the-resolved-path-to-the-path-to-resolve>

Last updated