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 akraken.py
or.kraken.py
file and runs it as a pure Python script.BuildDslScriptRunner
: Matches akraken.build
or.kraken.build
file and runs it as abuilddsl
script, with thebuildscript()
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.
Python | BuildDSL |
---|---|
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kraken_common-0.31.0.tar.gz
.
File metadata
- Download URL: kraken_common-0.31.0.tar.gz
- Upload date:
- Size: 23.4 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.15 tqdm/4.65.0 importlib-metadata/6.1.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67b9c323cea036d6af27b75fe11485e2ba9ab8052a5836d92c0e3cb0247194ae |
|
MD5 | 492e1da85dc8bef7f731ddd4909bdd8b |
|
BLAKE2b-256 | e27da13296703d684e82a0d0eca5749f8733b153d3d43df8a15f507476db5761 |
File details
Details for the file kraken_common-0.31.0-py3-none-any.whl
.
File metadata
- Download URL: kraken_common-0.31.0-py3-none-any.whl
- Upload date:
- Size: 30.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.15 tqdm/4.65.0 importlib-metadata/6.1.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d49f3d9f905395b435d1af35e3b1754724721514f0febcc7c0c18941bcda72 |
|
MD5 | a97c8c98c8d3ee4179d3cdb4d149b040 |
|
BLAKE2b-256 | 51edbc501fb1f7d163d520895a2e309817416bf70f376e0d6adab7899d20ab25 |