GitXplorerGitXplorer
T

kraken-common

public
0 stars
0 forks
0 issues

Commits

List of commits on branch develop.
Unverified
17464d4075533291d79bc3397d5ff4164f27ba28

release 0.5.2

NNiklasRosenstein committed 2 years ago
Unverified
36ba49fb98bc8c01e91d40d38aa697ab68cdb1f0

fix: fix `deprecated_get_requirement_spec_from_file_header()` to avoid the default python path to be spread out as individual items in the `RequirementSpec.pythonpath`

NNiklasRosenstein committed 2 years ago
Unverified
ff311360878c7adf07b62c70e08d07e8f6cc0e9e

release 0.5.1

NNiklasRosenstein committed 2 years ago
Unverified
9353711a61ad74c17e3668ba5c0777c3dde76a04

breaking change: rename `ProjectInfo.path` to `ProjectInfo.script` but we have no consumers of 0.5.0 so we keep this as a patch bump

NNiklasRosenstein committed 2 years ago
Unverified
5c97293f8148b0e25ad9a1891b2819c7ada875b3

release 0.5.0

NNiklasRosenstein committed 2 years ago
Unverified
ce2c26fbd7f48660af8523298bf30c0459e3bc71

update

NNiklasRosenstein committed 2 years ago

README

The README file for this repository.

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.

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()