pakages package

Subpackages

Submodules

pakages.build module

class pakages.build.BuildResult(builder, tmpdir, annotations=None)[source]

Bases: object

A BuildResult holds a set of content types and objects to upload.

We also store the builder name (e.g., Python) so we know how to extract.

add_archive(path, mediaType)[source]

Add an archive to the build result

add_title(path, title)[source]

Add a specific title for a blob.

push(target)[source]

Push archives to a target

remove()[source]

Delete temporary directory

summary()[source]

Print a summary of files

pakages.client module

class pakages.client.PakagesClient(*args, **kwargs)[source]

Bases: object

Pakages has a main controller for interacting with pakages.

build(*args, **kwargs)[source]

Build one or more packages.

install(packages, registry=None, tag=None, **kwargs)[source]

Install one or more packages.

push(uri, cache_dir=None, tag=None)[source]

Given an existing cache directory, push known specs to a specific uri

uninstall(packages)[source]

Uninstall a pakage

pakages.client.get_client(builder=None, settings_file=None)[source]

Get a pakages client

pakages.defaults module

pakages.logger module

class pakages.logger.ColorizingStreamHandler(nocolor=False, stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, use_threads=False)[source]

Bases: StreamHandler

BLACK = 0
BLUE = 4
BOLD_SEQ = '\x1b[1m'
COLOR_SEQ = '\x1b[%dm'
CYAN = 6
GREEN = 2
MAGENTA = 5
RED = 1
RESET_SEQ = '\x1b[0m'
WHITE = 7
YELLOW = 3
can_color_tty()[source]
colors = {'CRITICAL': 1, 'DEBUG': 4, 'ERROR': 1, 'INFO': 2, 'WARNING': 3}
decorate(record)[source]
emit(record)[source]

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.

property is_tty
class pakages.logger.Logger[source]

Bases: object

cleanup()[source]
debug(msg)[source]
error(msg)[source]
exit(msg, return_code=1)[source]
handler(msg)[source]
info(msg)[source]
location(msg)[source]
progress(done=None, total=None)[source]
set_level(level)[source]
set_stream_handler(stream_handler)[source]
shellcmd(msg)[source]
text_handler(msg)[source]

The default snakemake log handler. Prints the output to the console. Args:

msg (dict): the log message dictionary

warning(msg)[source]
pakages.logger.setup_logger(quiet=False, printshellcmds=False, nocolor=False, stdout=False, debug=False, use_threads=False, wms_monitor=None)[source]

pakages.oras module

class pakages.oras.Registry(hostname: str | None = None, insecure: bool = False)[source]

Bases: Registry

push(**kwargs)
pakages.oras.get_oras_client()[source]

Consistent method to get an oras client

pakages.oras.pull_to_dir(pull_dir, target)[source]

Given a URI, pull to an output directory.

pakages.schemas module

pakages.settings module

class pakages.settings.EmptySettings[source]

Bases: object

add(key, value)[source]

Add a value to a list parameter

change_validate(key, value)[source]

A courtesy function to validate a new config addition.

delete(key)[source]
edit()[source]

Interactively edit a config file.

get(key, default=None)[source]

Get a settings value, doing appropriate substitution and expansion.

get_settings_file(settings_file=None)[source]

Get the preferred used settings file.

inituser()[source]

Create a user specific config in user’s home.

load(settings_file=None)[source]

Load the settings file into the settings object

remove(key, value)[source]

Remove a value from a list parameter

save(filename=None)[source]

Save settings, but do not change order of anything.

set(key, value)[source]

Set a setting based on key and value. If the key has :, it’s nested

validate()[source]

Validate the loaded settings with jsonschema

class pakages.settings.Settings(settings_file, validate=True)[source]

Bases: EmptySettings

The settings class is a wrapper for easily parsing a settings.yml file.

We parse into a query-able class. It also gives us control to update settings, meaning we change the values and then write them to file. It’s basically a dictionary-like class with extra functions.

pakages.version module

pakages.worker module

class pakages.worker.Workers(workers=None)[source]

Bases: object

end()[source]
run(funcs: dict, tasks: dict) dict | None[source]

Run will send a list of tasks, a tuple with arguments, through a function. the arguments should be ordered correctly.

Args:
  • funcs (dict)the functions to run with multiprocessing.pool,

    a dictionary with lookup by the task name

  • tasks (dict)a dict of tasks, each task name (key) with a tuple

    of arguments to process

start()[source]
pakages.worker.init_worker()[source]
pakages.worker.multi_package(func, kwargs)[source]
pakages.worker.multi_wrapper(func_args)[source]

Module contents