Skip to main content

No project description provided

Project description

kraken-common

The kraken-common package is the shared utility namespace for the Kraken build system and the Kraken wrapper CLI. It contains various generic utilities, as well as the tools for loading the metadata of a Kraken project.

Aside from general utilities that are used by one, the other or both, this package also implements the shared logic for executing Kraken Python and BuildDSL build scripts and retrieving its metadata.

Script runners

The following types of Kraken script runners are currently available via the kraken.common package:

  • PythonScriptRunner: Matches a kraken.py or .kraken.py file and runs it as a pure Python script.
  • BuildDslScriptRunner: Matches a kraken.build or .kraken.build file and runs it as a builddsl script, with the buildscript() function being available by default.

Buildscript metadata

A Kraken project contains at least one .kraken.py file (build script) and maybe a .kraken.lock file (lock file). The build script at the root of a project may contain hints for the Kraken wrapper CLI to be able to correctly bootstrap an environment that contains the Kraken build system.

PythonBuildDSL
from kraken.common import buildscript

buildscript(
    requirements=["kraken-std ^0.4.16"],
)
buildscript {
    requires "kraken-std ^0.4.16"
}

The way that this works is that the buildscript() function raises an exception that aborts the execution of the build script before the rest of the script is executed, and the exception contains the metadata. When the build script is executed by the Kraken build system instead, the function does nothing.

The API to capture the data passed to a call to the buildscript() function is as follows:

from kraken.common import BuildscriptMetadata

with BuildscriptMetadata.capture() as metadata_future:
    ...

metadata = metadata_future.result()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kraken_common-0.31.5.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

kraken_common-0.31.5-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file kraken_common-0.31.5.tar.gz.

File metadata

  • Download URL: kraken_common-0.31.5.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.12

File hashes

Hashes for kraken_common-0.31.5.tar.gz
Algorithm Hash digest
SHA256 c4ad7a5d1fa77718c7c552b37ab175ba043710e975d32d7280a27cdc1f4e3446
MD5 66eda9eb5ca8d19e00f83ee723feff22
BLAKE2b-256 8f745c35738c5a4a0c20a575d0a5131c5f81aace8b8ac5e83a45a342186f7841

See more details on using hashes here.

File details

Details for the file kraken_common-0.31.5-py3-none-any.whl.

File metadata

  • Download URL: kraken_common-0.31.5-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.12

File hashes

Hashes for kraken_common-0.31.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0fe5da93c8313688a3b361abfac8e3946c34b3c7b521ccba4db9a76a3c21b335
MD5 562ae6d4df30f81ef2de84d15bffc3a2
BLAKE2b-256 087b86354dbfcef18aefb678ecf37b0604f300977241c825b66097e7ebc50f28

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page