vmklib.tasks package#

Subpackages#

Submodules#

vmklib.tasks.args module#

A module for assisting with getting optional arguments for tasks.

vmklib.tasks.args.environ_fallback(key: str, _default: Any = None, **kwargs) Any[source]#

Attempt to retrieve a value from keyword arguments, otherwise also fall back to system environment variables.

vmklib.tasks.args.environ_fallback_split(key: str, **kwargs) List[str][source]#

Get whitespace-separated arguments from the environment or keyword arguments.

vmklib.tasks.clean module#

A module implementing a ‘clean’ task.

class vmklib.tasks.clean.Clean(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: VmklibBase

A class for removing files and directories.

async run(inbox: Dict[str, Dict[str, Any]], outbox: Dict[str, Any], *args, **kwargs) bool[source]#

Generate ninja configuration files.

vmklib.tasks.github module#

A module for working with GitHub APIs.

vmklib.tasks.github.ensure_api_token(token: str) None[source]#

Ensure the API token header is added to the curl arguments.

vmklib.tasks.github.repo_url(owner: str, repo: str, kind: str = 'api', endpoint: str = 'releases') str[source]#

Get a GitHub API URL.

vmklib.tasks.release module#

A module implementing a release task for Python projects.

class vmklib.tasks.release.GithubRelease(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: CurlMixin

A task for creating a GitHub release for a given package.

async create_release(owner: str, repo: str, data: Dict[str, Any]) Dict[str, Any][source]#

Attempt to create a release.

async release(cwd: Path, owner: str, repo: str, version: str, dist: str = 'dist') bool[source]#

Create a release.

async run(inbox: Dict[str, Dict[str, Any]], outbox: Dict[str, Any], *args, **kwargs) bool[source]#

Generate ninja configuration files.

async upload_release_asset(owner: str, repo: str, release_id: int, path: Path) Dict[str, Any][source]#

Attempt to upload a release asset.

vmklib.tasks.venv module#

A module for registering virtual environment tasks.

class vmklib.tasks.venv.RequirementsInstaller(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: ConcreteBuilderMixin, SubprocessLogMixin

A task for installing requirements files.

async run(inbox: Dict[str, Dict[str, Any]], outbox: Dict[str, Any], *args, **kwargs) bool[source]#

Install a requirements file.

class vmklib.tasks.venv.Venv(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: ConcreteBuilderMixin, SubprocessLogMixin

A target prototype for creating a virtual environment.

async run(inbox: Dict[str, Dict[str, Any]], outbox: Dict[str, Any], *args, **kwargs) bool[source]#

Create or update a project’s virtual environment.

async run_enter(_inbox: Dict[str, Dict[str, Any]], _outbox: Dict[str, Any], *_args, **_kwargs) bool[source]#

Check if the virtual environment gets created and expose useful data to the outbox.

vmklib.tasks.venv.register(manager: TaskManager, project: str, cwd: Path, substitutions: Dict[str, str]) bool[source]#

Register virtual environment tasks to the manager.

Module contents#

A module implementing a base task.

class vmklib.tasks.VmklibBase(name: str, *args, execute: Callable[[Dict[str, Dict[str, Any]], Dict[str, Any]], Coroutine[Any, Any, bool]] = None, log: Logger = None, timer: Timer = None, target: Target = None, **kwargs)[source]#

Bases: Task

Create a concrete file output after a task completes.

classmethod build_dir(inbox: Dict[str, Dict[str, Any]]) Path[source]#

Get a path to the build directory.

default_requirements: _Set[str] = {'vmklib.init'}#