python3Packages.shacl2code: init at 1.2.0

Convert SHACL model to code bindings

https://github.com/JPEWdev/shacl2code
This commit is contained in:
Fabian Affolter
2026-08-16 23:36:07 +02:00
parent d0b19e1b97
commit ea902f8e6f
2 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
jinja2,
jsonschema,
nix-update-script,
pyrefly,
pyright,
pyshacl,
pytest-cov-stub,
pytest-xdist,
pytestCheckHook,
rdflib,
types-jsonschema,
}:
buildPythonPackage (finalAttrs: {
pname = "shacl2code";
version = "1.2.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "JPEWdev";
repo = "shacl2code";
tag = "v${finalAttrs.version}";
hash = "sha256-YGZLvJRoA0sMjTvYYChZMWtERjXLWgHe1WgzNEG9xGc=";
};
build-system = [ hatchling ];
dependencies = [
jinja2
rdflib
];
nativeCheckInputs = [
jsonschema
pyrefly
pyright
pyshacl
pytest-cov-stub
pytest-xdist
pytestCheckHook
types-jsonschema
];
preCheck = ''
export PATH="$out/bin:$PATH"
'';
pythonImportsCheck = [ "shacl2code" ];
disabledTestPaths = [
# Tests want to generate and run code
"tests/test_context.py"
"tests/test_cpp.py"
"tests/test_golang.py"
"tests/test_jsonschema.py"
"tests/test_lint.py"
"tests/test_python.py"
"tests/test_rust.py"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Convert SHACL model to code bindings";
homepage = "https://github.com/JPEWdev/shacl2code";
changelog = "https://github.com/JPEWdev/shacl2code/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
})

View File

@@ -18798,6 +18798,8 @@ self: super: with self; {
sh = callPackage ../development/python-modules/sh { };
shacl2code = callPackage ../development/python-modules/shacl2code { };
shamir-mnemonic = callPackage ../development/python-modules/shamir-mnemonic { };
shap = callPackage ../development/python-modules/shap { };