whisk.project

Module Contents

Classes

Project

Abstracts project-level attributes into a class.

class whisk.project.Project(dir=os.getcwd(), module_dir=None)[source]

Abstracts project-level attributes into a class.

dir[source]

The top-level project directory (str)

path[source]

The top-level project directory as a pathlib.Path

name[source]

Name of the project derived from the src/<project_name> directory (str)

module_dir[source]

Location of the project’s module directory as a pathlib.Path. This is derived from path if not provided.

artifacts_dir[source]

Location of the project’s artifacts directory as a pathlib.Path. This is derived from path if not provided.

classmethod from_module(cls, path)[source]

Takes a path from a generated project’s src/{{name}}/__init__.py file and returns a Project object Initialized w/that path.

name_from_src_dir(self, src_dir)[source]

Derives the project name from the first child directory in the src/ directory that contains an __init__.py file.

src_dirpathlib.Path

Path object referencing the project src/ directory.

validate_in_project(self)[source]

Raises an OSError if this is not a whisk project.

is_git_repo(self)[source]
has_unstaged_changes(self)[source]
in_project(self)[source]

Returns True if the project’s path is the root whisk project directory.

This is deteremined by the presence of the “.whisk/” directory.