Merge pull request #331173 from greg-hellings/init-grep-ast
python312Packages.grep-ast: init at 0.3.3
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
{
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
lib,
|
||||
|
||||
pathspec,
|
||||
pytestCheckHook,
|
||||
setuptools,
|
||||
tree-sitter-languages,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "grep-ast";
|
||||
version = "0.3.3";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "grep_ast";
|
||||
hash = "sha256-QriIfVcwHcVWNDaPjVSenEnJE9r7TRnJtUw922BPzPQ=";
|
||||
};
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [
|
||||
pathspec
|
||||
tree-sitter-languages
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonImportsCheck = [ "grep_ast" ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/paul-gauthier/grep-ast";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ greg ];
|
||||
description = "Python implementation of the ast-grep tool";
|
||||
mainProgram = "grep-ast";
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
pythonOlder,
|
||||
pythonAtLeast,
|
||||
setuptools,
|
||||
distutils,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -13,8 +14,7 @@ buildPythonPackage rec {
|
||||
version = "0.21.3";
|
||||
pyproject = true;
|
||||
|
||||
# https://github.com/tree-sitter/py-tree-sitter/issues/209
|
||||
disabled = pythonAtLeast "3.12" || pythonOlder "3.7";
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tree-sitter";
|
||||
@@ -30,6 +30,10 @@ buildPythonPackage rec {
|
||||
|
||||
pythonImportsCheck = [ "tree_sitter" ];
|
||||
|
||||
# Needed explicitly for Python >= 3.12 as tree-sitter provides
|
||||
# calls to distutils functions to compile language files
|
||||
dependencies = lib.optionals (pythonAtLeast "3.12") [ distutils ];
|
||||
|
||||
preCheck = ''
|
||||
rm -r tree_sitter
|
||||
'';
|
||||
|
||||
@@ -5297,6 +5297,8 @@ self: super: with self; {
|
||||
|
||||
gremlinpython = callPackage ../development/python-modules/gremlinpython { };
|
||||
|
||||
grep-ast = callPackage ../development/python-modules/grep-ast { };
|
||||
|
||||
greynoise = callPackage ../development/python-modules/greynoise { };
|
||||
|
||||
growattserver = callPackage ../development/python-modules/growattserver { };
|
||||
|
||||
Reference in New Issue
Block a user