python3Packages.tree-sitter-zeek: init at 0.2.9; zeekscript: update, unbreak, modernize (#447878)

This commit is contained in:
Sandro 2025-10-29 11:56:31 +00:00 committed by GitHub
commit 27d531766c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 16 deletions

View file

@ -1,32 +1,36 @@
{
lib,
python3,
fetchPypi,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "zeekscript";
version = "1.2.8";
version = "1.3.2-unstable-2025-09-29";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-v0PJY0Ahxa4k011AwtWSIAWBXvt3Aybrd382j1SIT6M=";
src = fetchFromGitHub {
owner = "zeek";
repo = "zeekscript";
rev = "f0fa5746633a709759a94695fcc81b43feb8e2d9";
hash = "sha256-g4Iv9xw6Owuqi+UudRzWatK09mjNDWdp0cBvH7iuV+U=";
};
postPatch = ''
sed -i '/name = "zeekscript"/a version = "${version}"' pyproject.toml
'';
build-system = with python3.pkgs; [ setuptools ];
nativeBuildInputs = with python3.pkgs; [
setuptools
wheel
];
propagatedBuildInputs = with python3.pkgs; [
dependencies = with python3.pkgs; [
argcomplete
tree-sitter
tree-sitter-zeek
];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
pytest-cov-stub
];
checkInputs = with python3.pkgs; [ syrupy ];
pythonImportsCheck = [
"zeekscript"
];
@ -34,13 +38,12 @@ python3.pkgs.buildPythonApplication rec {
meta = {
description = "Zeek script formatter and analyzer";
homepage = "https://github.com/zeek/zeekscript";
changelog = "https://github.com/zeek/zeekscript/blob/v${version}/CHANGES";
changelog = "https://github.com/zeek/zeekscript/blob/${src.rev}/CHANGES";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
fab
tobim
mdaniels5757
];
# Incompatible with tree-sitter > 0.21.
broken = true;
};
}

View file

@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
tree-sitter,
}:
buildPythonPackage rec {
pname = "tree-sitter-zeek";
version = "0.2.9";
pyproject = true;
src = fetchFromGitHub {
owner = "zeek";
repo = "tree-sitter-zeek";
tag = "v${version}";
hash = "sha256-0ixZAJ940mYIPD//RJVJ3PAVdY/jtYNJ5+WIlq+zfnY=";
};
build-system = [ setuptools ];
optional-dependencies = {
core = [ tree-sitter ];
};
pythonImportsCheck = [ "tree_sitter_zeek" ];
meta = {
description = "Tree-sitter grammar for the Zeek scripting language";
homepage = "https://github.com/zeek/tree-sitter-zeek";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
mdaniels5757
];
};
}

View file

@ -18819,6 +18819,8 @@ self: super: with self; {
tree-sitter-yaml = callPackage ../development/python-modules/tree-sitter-yaml { };
tree-sitter-zeek = callPackage ../development/python-modules/tree-sitter-zeek { };
treelib = callPackage ../development/python-modules/treelib { };
treelog = callPackage ../development/python-modules/treelog { };