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.24.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

kraken_common-0.24.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kraken_common-0.24.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.9

File hashes

Hashes for kraken_common-0.24.0.tar.gz
Algorithm Hash digest
SHA256 4e8375d73373d0459914d95aac5a080823d7c7df32b7076f0e92d7d0afabc7fe
MD5 3321fa48d26024bf288589b8d23d096e
BLAKE2b-256 93d3b093c6894f216a5e1ec09143ab7aa9b182ba4fe61941bcd9e08d8746705a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kraken_common-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.9

File hashes

Hashes for kraken_common-0.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5dd6af76fa3098ce01f235a73d3e5c432a1e114e9e0a1e170c74a20aafde5a4
MD5 742f6317bbfd0f8e0125043e226a36fd
BLAKE2b-256 071cf4c5f1567009a3f0779adb742540aa2bb0089ad4c19a571454275b6228c9

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