tree-sitter-ghactions 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tree_sitter_ghactions-0.1.2/PKG-INFO +75 -0
- tree_sitter_ghactions-0.1.2/README.md +58 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions/__init__.py +53 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions/__init__.pyi +10 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions/binding.c +32 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions/py.typed +0 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/PKG-INFO +75 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/SOURCES.txt +14 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/dependency_links.txt +1 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/not-zip-safe +1 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/requires.txt +3 -0
- tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/top_level.txt +2 -0
- tree_sitter_ghactions-0.1.2/pyproject.toml +29 -0
- tree_sitter_ghactions-0.1.2/queries/highlights.scm +83 -0
- tree_sitter_ghactions-0.1.2/setup.cfg +4 -0
- tree_sitter_ghactions-0.1.2/setup.py +77 -0
- tree_sitter_ghactions-0.1.2/src/parser.c +2010 -0
- tree_sitter_ghactions-0.1.2/src/tree_sitter/alloc.h +54 -0
- tree_sitter_ghactions-0.1.2/src/tree_sitter/array.h +291 -0
- tree_sitter_ghactions-0.1.2/src/tree_sitter/parser.h +286 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: tree-sitter-ghactions
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: Parser for Github Actions expressions
|
5
|
+
Author-email: Robert Muir <rmuir@apache.org>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/rmuir/tree-sitter-ghactions
|
8
|
+
Keywords: incremental,parsing,tree-sitter,github,actions
|
9
|
+
Classifier: Intended Audience :: Developers
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
12
|
+
Classifier: Typing :: Typed
|
13
|
+
Requires-Python: >=3.10
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
Provides-Extra: core
|
16
|
+
Requires-Dist: tree-sitter~=0.25; extra == "core"
|
17
|
+
|
18
|
+
# tree-sitter-ghactions
|
19
|
+
|
20
|
+
Github Actions expressions grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
21
|
+
|
22
|
+
## Features
|
23
|
+
|
24
|
+
* Parses Github Action's expressions: `${{ ... }}`
|
25
|
+
* Plays well with `bash` injections in YAML documents
|
26
|
+
* Passes parsing tests from [actionlint](https://github.com/rhysd/actionlint)
|
27
|
+
|
28
|
+
## Neovim Installation (for use in your editor)
|
29
|
+
|
30
|
+
1. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main)
|
31
|
+
|
32
|
+
2. Configure autocmd for a custom parser:
|
33
|
+
|
34
|
+
```lua
|
35
|
+
-- custom parsers
|
36
|
+
vim.api.nvim_create_autocmd('User', {
|
37
|
+
pattern = 'TSUpdate',
|
38
|
+
callback = function()
|
39
|
+
require('nvim-treesitter.parsers').ghactions = {
|
40
|
+
install_info = {
|
41
|
+
url = 'https://github.com/rmuir/tree-sitter-ghactions',
|
42
|
+
queries = 'queries',
|
43
|
+
},
|
44
|
+
}
|
45
|
+
end,
|
46
|
+
})
|
47
|
+
```
|
48
|
+
|
49
|
+
3. Configure yaml injection in `~/.config/nvim/queries/yaml/injections.scm`:
|
50
|
+
```tsq
|
51
|
+
; extends
|
52
|
+
|
53
|
+
; github actions
|
54
|
+
([
|
55
|
+
(string_scalar)
|
56
|
+
(block_scalar)
|
57
|
+
(double_quote_scalar)
|
58
|
+
(single_quote_scalar)
|
59
|
+
] @injection.content
|
60
|
+
(#lua-match? @injection.content "[$]{{.*}}")
|
61
|
+
(#set! injection.language "ghactions"))
|
62
|
+
```
|
63
|
+
|
64
|
+
4. Run `:TSUpdate` from neovim.
|
65
|
+
|
66
|
+
NOTE: these instructions are based upon the `main` branch of `nvim-treesitter`.
|
67
|
+
|
68
|
+
## Bindings Installation (for development)
|
69
|
+
|
70
|
+
Bindings are published to `pypi`, `npm`, and `crates.io` as `tree-sitter-ghactions`.
|
71
|
+
Wasm and source code artifacts are published to [GitHub releases](https://github.com/rmuir/tree-sitter-ghactions/releases)
|
72
|
+
|
73
|
+
## Screenshot of highlights
|
74
|
+
|
75
|
+

|
@@ -0,0 +1,58 @@
|
|
1
|
+
# tree-sitter-ghactions
|
2
|
+
|
3
|
+
Github Actions expressions grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
* Parses Github Action's expressions: `${{ ... }}`
|
8
|
+
* Plays well with `bash` injections in YAML documents
|
9
|
+
* Passes parsing tests from [actionlint](https://github.com/rhysd/actionlint)
|
10
|
+
|
11
|
+
## Neovim Installation (for use in your editor)
|
12
|
+
|
13
|
+
1. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main)
|
14
|
+
|
15
|
+
2. Configure autocmd for a custom parser:
|
16
|
+
|
17
|
+
```lua
|
18
|
+
-- custom parsers
|
19
|
+
vim.api.nvim_create_autocmd('User', {
|
20
|
+
pattern = 'TSUpdate',
|
21
|
+
callback = function()
|
22
|
+
require('nvim-treesitter.parsers').ghactions = {
|
23
|
+
install_info = {
|
24
|
+
url = 'https://github.com/rmuir/tree-sitter-ghactions',
|
25
|
+
queries = 'queries',
|
26
|
+
},
|
27
|
+
}
|
28
|
+
end,
|
29
|
+
})
|
30
|
+
```
|
31
|
+
|
32
|
+
3. Configure yaml injection in `~/.config/nvim/queries/yaml/injections.scm`:
|
33
|
+
```tsq
|
34
|
+
; extends
|
35
|
+
|
36
|
+
; github actions
|
37
|
+
([
|
38
|
+
(string_scalar)
|
39
|
+
(block_scalar)
|
40
|
+
(double_quote_scalar)
|
41
|
+
(single_quote_scalar)
|
42
|
+
] @injection.content
|
43
|
+
(#lua-match? @injection.content "[$]{{.*}}")
|
44
|
+
(#set! injection.language "ghactions"))
|
45
|
+
```
|
46
|
+
|
47
|
+
4. Run `:TSUpdate` from neovim.
|
48
|
+
|
49
|
+
NOTE: these instructions are based upon the `main` branch of `nvim-treesitter`.
|
50
|
+
|
51
|
+
## Bindings Installation (for development)
|
52
|
+
|
53
|
+
Bindings are published to `pypi`, `npm`, and `crates.io` as `tree-sitter-ghactions`.
|
54
|
+
Wasm and source code artifacts are published to [GitHub releases](https://github.com/rmuir/tree-sitter-ghactions/releases)
|
55
|
+
|
56
|
+
## Screenshot of highlights
|
57
|
+
|
58
|
+

|
@@ -0,0 +1,53 @@
|
|
1
|
+
"""Parser for Github Actions expressions"""
|
2
|
+
|
3
|
+
from importlib.resources import files as _files
|
4
|
+
|
5
|
+
from ._binding import language
|
6
|
+
|
7
|
+
|
8
|
+
def _get_query(name, file):
|
9
|
+
query = _files(f"{__package__}.queries") / file
|
10
|
+
globals()[name] = query.read_text()
|
11
|
+
return globals()[name]
|
12
|
+
|
13
|
+
|
14
|
+
def __getattr__(name):
|
15
|
+
# NOTE: uncomment these to include any queries that this grammar contains:
|
16
|
+
|
17
|
+
if name == "HIGHLIGHTS_QUERY":
|
18
|
+
return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
|
19
|
+
# if name == "INJECTIONS_QUERY":
|
20
|
+
# return _get_query("INJECTIONS_QUERY", "injections.scm")
|
21
|
+
# if name == "LOCALS_QUERY":
|
22
|
+
# return _get_query("LOCALS_QUERY", "locals.scm")
|
23
|
+
# if name == "TAGS_QUERY":
|
24
|
+
# return _get_query("TAGS_QUERY", "tags.scm")
|
25
|
+
|
26
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
27
|
+
|
28
|
+
|
29
|
+
__all__ = [
|
30
|
+
"language",
|
31
|
+
"HIGHLIGHTS_QUERY",
|
32
|
+
# "INJECTIONS_QUERY",
|
33
|
+
# "LOCALS_QUERY",
|
34
|
+
# "TAGS_QUERY",
|
35
|
+
]
|
36
|
+
|
37
|
+
|
38
|
+
def __dir__():
|
39
|
+
return sorted(
|
40
|
+
__all__
|
41
|
+
+ [
|
42
|
+
"__all__",
|
43
|
+
"__builtins__",
|
44
|
+
"__cached__",
|
45
|
+
"__doc__",
|
46
|
+
"__file__",
|
47
|
+
"__loader__",
|
48
|
+
"__name__",
|
49
|
+
"__package__",
|
50
|
+
"__path__",
|
51
|
+
"__spec__",
|
52
|
+
]
|
53
|
+
)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#include <Python.h>
|
2
|
+
|
3
|
+
typedef struct TSLanguage TSLanguage;
|
4
|
+
|
5
|
+
TSLanguage *tree_sitter_ghactions(void);
|
6
|
+
|
7
|
+
static PyObject *_binding_language(PyObject *Py_UNUSED(self),
|
8
|
+
PyObject *Py_UNUSED(args)) {
|
9
|
+
return PyCapsule_New(tree_sitter_ghactions(), "tree_sitter.Language", NULL);
|
10
|
+
}
|
11
|
+
|
12
|
+
static struct PyModuleDef_Slot slots[] = {
|
13
|
+
#ifdef Py_GIL_DISABLED
|
14
|
+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
15
|
+
#endif
|
16
|
+
{0, NULL}};
|
17
|
+
|
18
|
+
static PyMethodDef methods[] = {
|
19
|
+
{"language", _binding_language, METH_NOARGS,
|
20
|
+
"Get the tree-sitter language for this grammar."},
|
21
|
+
{NULL, NULL, 0, NULL}};
|
22
|
+
|
23
|
+
static struct PyModuleDef module = {
|
24
|
+
.m_base = PyModuleDef_HEAD_INIT,
|
25
|
+
.m_name = "_binding",
|
26
|
+
.m_doc = NULL,
|
27
|
+
.m_size = 0,
|
28
|
+
.m_methods = methods,
|
29
|
+
.m_slots = slots,
|
30
|
+
};
|
31
|
+
|
32
|
+
PyMODINIT_FUNC PyInit__binding(void) { return PyModuleDef_Init(&module); }
|
File without changes
|
@@ -0,0 +1,75 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: tree-sitter-ghactions
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: Parser for Github Actions expressions
|
5
|
+
Author-email: Robert Muir <rmuir@apache.org>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/rmuir/tree-sitter-ghactions
|
8
|
+
Keywords: incremental,parsing,tree-sitter,github,actions
|
9
|
+
Classifier: Intended Audience :: Developers
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
12
|
+
Classifier: Typing :: Typed
|
13
|
+
Requires-Python: >=3.10
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
Provides-Extra: core
|
16
|
+
Requires-Dist: tree-sitter~=0.25; extra == "core"
|
17
|
+
|
18
|
+
# tree-sitter-ghactions
|
19
|
+
|
20
|
+
Github Actions expressions grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
21
|
+
|
22
|
+
## Features
|
23
|
+
|
24
|
+
* Parses Github Action's expressions: `${{ ... }}`
|
25
|
+
* Plays well with `bash` injections in YAML documents
|
26
|
+
* Passes parsing tests from [actionlint](https://github.com/rhysd/actionlint)
|
27
|
+
|
28
|
+
## Neovim Installation (for use in your editor)
|
29
|
+
|
30
|
+
1. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main)
|
31
|
+
|
32
|
+
2. Configure autocmd for a custom parser:
|
33
|
+
|
34
|
+
```lua
|
35
|
+
-- custom parsers
|
36
|
+
vim.api.nvim_create_autocmd('User', {
|
37
|
+
pattern = 'TSUpdate',
|
38
|
+
callback = function()
|
39
|
+
require('nvim-treesitter.parsers').ghactions = {
|
40
|
+
install_info = {
|
41
|
+
url = 'https://github.com/rmuir/tree-sitter-ghactions',
|
42
|
+
queries = 'queries',
|
43
|
+
},
|
44
|
+
}
|
45
|
+
end,
|
46
|
+
})
|
47
|
+
```
|
48
|
+
|
49
|
+
3. Configure yaml injection in `~/.config/nvim/queries/yaml/injections.scm`:
|
50
|
+
```tsq
|
51
|
+
; extends
|
52
|
+
|
53
|
+
; github actions
|
54
|
+
([
|
55
|
+
(string_scalar)
|
56
|
+
(block_scalar)
|
57
|
+
(double_quote_scalar)
|
58
|
+
(single_quote_scalar)
|
59
|
+
] @injection.content
|
60
|
+
(#lua-match? @injection.content "[$]{{.*}}")
|
61
|
+
(#set! injection.language "ghactions"))
|
62
|
+
```
|
63
|
+
|
64
|
+
4. Run `:TSUpdate` from neovim.
|
65
|
+
|
66
|
+
NOTE: these instructions are based upon the `main` branch of `nvim-treesitter`.
|
67
|
+
|
68
|
+
## Bindings Installation (for development)
|
69
|
+
|
70
|
+
Bindings are published to `pypi`, `npm`, and `crates.io` as `tree-sitter-ghactions`.
|
71
|
+
Wasm and source code artifacts are published to [GitHub releases](https://github.com/rmuir/tree-sitter-ghactions/releases)
|
72
|
+
|
73
|
+
## Screenshot of highlights
|
74
|
+
|
75
|
+

|
@@ -0,0 +1,14 @@
|
|
1
|
+
README.md
|
2
|
+
pyproject.toml
|
3
|
+
setup.py
|
4
|
+
bindings/python/tree_sitter_ghactions/__init__.py
|
5
|
+
bindings/python/tree_sitter_ghactions/__init__.pyi
|
6
|
+
bindings/python/tree_sitter_ghactions/binding.c
|
7
|
+
bindings/python/tree_sitter_ghactions/py.typed
|
8
|
+
bindings/python/tree_sitter_ghactions.egg-info/PKG-INFO
|
9
|
+
bindings/python/tree_sitter_ghactions.egg-info/SOURCES.txt
|
10
|
+
bindings/python/tree_sitter_ghactions.egg-info/dependency_links.txt
|
11
|
+
bindings/python/tree_sitter_ghactions.egg-info/not-zip-safe
|
12
|
+
bindings/python/tree_sitter_ghactions.egg-info/requires.txt
|
13
|
+
bindings/python/tree_sitter_ghactions.egg-info/top_level.txt
|
14
|
+
src/parser.c
|
tree_sitter_ghactions-0.1.2/bindings/python/tree_sitter_ghactions.egg-info/dependency_links.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools>=62.4.0", "wheel"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "tree-sitter-ghactions"
|
7
|
+
description = "Parser for Github Actions expressions"
|
8
|
+
version = "0.1.2"
|
9
|
+
keywords = ["incremental", "parsing", "tree-sitter", "github", "actions"]
|
10
|
+
classifiers = [
|
11
|
+
"Intended Audience :: Developers",
|
12
|
+
"Topic :: Software Development :: Compilers",
|
13
|
+
"Topic :: Text Processing :: Linguistic",
|
14
|
+
"Typing :: Typed",
|
15
|
+
]
|
16
|
+
authors = [{ name = "Robert Muir", email = "rmuir@apache.org" }]
|
17
|
+
requires-python = ">=3.10"
|
18
|
+
license.text = "MIT"
|
19
|
+
readme = "README.md"
|
20
|
+
|
21
|
+
[project.urls]
|
22
|
+
Homepage = "https://github.com/rmuir/tree-sitter-ghactions"
|
23
|
+
|
24
|
+
[project.optional-dependencies]
|
25
|
+
core = ["tree-sitter~=0.25"]
|
26
|
+
|
27
|
+
[tool.cibuildwheel]
|
28
|
+
build = "cp310-*"
|
29
|
+
build-frontend = "build"
|
@@ -0,0 +1,83 @@
|
|
1
|
+
; note: all highlights are set to priority 101, for compatibility with bash injections in yaml
|
2
|
+
([
|
3
|
+
"${{"
|
4
|
+
"}}"
|
5
|
+
] @keyword
|
6
|
+
(#set! priority 101))
|
7
|
+
|
8
|
+
([
|
9
|
+
"&&"
|
10
|
+
"||"
|
11
|
+
"=="
|
12
|
+
"!="
|
13
|
+
"<"
|
14
|
+
"<="
|
15
|
+
">"
|
16
|
+
">="
|
17
|
+
"+"
|
18
|
+
"-"
|
19
|
+
"!"
|
20
|
+
] @operator
|
21
|
+
(#set! priority 101))
|
22
|
+
|
23
|
+
([
|
24
|
+
"("
|
25
|
+
")"
|
26
|
+
"["
|
27
|
+
"]"
|
28
|
+
] @punctuation.bracket
|
29
|
+
(#set! priority 101))
|
30
|
+
|
31
|
+
([
|
32
|
+
","
|
33
|
+
"."
|
34
|
+
] @punctuation.delimiter
|
35
|
+
(#set! priority 101))
|
36
|
+
|
37
|
+
("*" @punctuation.special
|
38
|
+
(#set! priority 101))
|
39
|
+
|
40
|
+
((number) @number
|
41
|
+
(#set! priority 101))
|
42
|
+
|
43
|
+
((identifier) @variable
|
44
|
+
(#set! priority 101))
|
45
|
+
|
46
|
+
; https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
|
47
|
+
(dereference_expression
|
48
|
+
object: (identifier) @module.builtin
|
49
|
+
(#any-of? @module.builtin
|
50
|
+
"github" "env" "vars" "job" "jobs" "steps" "runner" "secrets" "strategy" "matrix" "needs"
|
51
|
+
"inputs")
|
52
|
+
(#set! priority 101))
|
53
|
+
|
54
|
+
((dereference_expression
|
55
|
+
property: (identifier) @property)
|
56
|
+
(#set! priority 101))
|
57
|
+
|
58
|
+
((function_call
|
59
|
+
name: (identifier) @function.call)
|
60
|
+
(#set! priority 101))
|
61
|
+
|
62
|
+
; https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#functions
|
63
|
+
((function_call
|
64
|
+
name: (identifier) @function.builtin
|
65
|
+
(#any-of? @function.builtin
|
66
|
+
"contains" "startsWith" "endsWith" "format" "join" "toJSON" "fromJSON" "hashFiles" "success"
|
67
|
+
"always" "cancelled" "failure"))
|
68
|
+
(#set! priority 101))
|
69
|
+
|
70
|
+
([
|
71
|
+
(true)
|
72
|
+
(false)
|
73
|
+
] @boolean
|
74
|
+
(#set! priority 101))
|
75
|
+
|
76
|
+
((null) @constant.builtin
|
77
|
+
(#set! priority 101))
|
78
|
+
|
79
|
+
((string) @string
|
80
|
+
(#set! priority 101))
|
81
|
+
|
82
|
+
((escape) @string.escape
|
83
|
+
(#set! priority 101))
|
@@ -0,0 +1,77 @@
|
|
1
|
+
from os import path
|
2
|
+
from platform import system
|
3
|
+
from sysconfig import get_config_var
|
4
|
+
|
5
|
+
from setuptools import Extension, find_packages, setup
|
6
|
+
from setuptools.command.build import build
|
7
|
+
from setuptools.command.egg_info import egg_info
|
8
|
+
from wheel.bdist_wheel import bdist_wheel
|
9
|
+
|
10
|
+
sources = [
|
11
|
+
"bindings/python/tree_sitter_ghactions/binding.c",
|
12
|
+
"src/parser.c",
|
13
|
+
]
|
14
|
+
if path.exists("src/scanner.c"):
|
15
|
+
sources.append("src/scanner.c")
|
16
|
+
|
17
|
+
macros: list[tuple[str, str | None]] = [
|
18
|
+
("PY_SSIZE_T_CLEAN", None),
|
19
|
+
("TREE_SITTER_HIDE_SYMBOLS", None),
|
20
|
+
]
|
21
|
+
if limited_api := not get_config_var("Py_GIL_DISABLED"):
|
22
|
+
macros.append(("Py_LIMITED_API", "0x030A0000"))
|
23
|
+
|
24
|
+
if system() != "Windows":
|
25
|
+
cflags = ["-std=c11", "-fvisibility=hidden"]
|
26
|
+
else:
|
27
|
+
cflags = ["/std:c11", "/utf-8"]
|
28
|
+
|
29
|
+
|
30
|
+
class Build(build):
|
31
|
+
def run(self):
|
32
|
+
if path.isdir("queries"):
|
33
|
+
dest = path.join(self.build_lib, "tree_sitter_ghactions", "queries")
|
34
|
+
self.copy_tree("queries", dest)
|
35
|
+
super().run()
|
36
|
+
|
37
|
+
|
38
|
+
class BdistWheel(bdist_wheel):
|
39
|
+
def get_tag(self):
|
40
|
+
python, abi, platform = super().get_tag()
|
41
|
+
if python.startswith("cp"):
|
42
|
+
python, abi = "cp310", "abi3"
|
43
|
+
return python, abi, platform
|
44
|
+
|
45
|
+
|
46
|
+
class EggInfo(egg_info):
|
47
|
+
def find_sources(self):
|
48
|
+
super().find_sources()
|
49
|
+
self.filelist.recursive_include("queries", "*.scm")
|
50
|
+
self.filelist.include("src/tree_sitter/*.h")
|
51
|
+
|
52
|
+
|
53
|
+
setup(
|
54
|
+
packages=find_packages("bindings/python"),
|
55
|
+
package_dir={"": "bindings/python"},
|
56
|
+
package_data={
|
57
|
+
"tree_sitter_ghactions": ["*.pyi", "py.typed"],
|
58
|
+
"tree_sitter_ghactions.queries": ["*.scm"],
|
59
|
+
},
|
60
|
+
ext_package="tree_sitter_ghactions",
|
61
|
+
ext_modules=[
|
62
|
+
Extension(
|
63
|
+
name="_binding",
|
64
|
+
sources=sources,
|
65
|
+
extra_compile_args=cflags,
|
66
|
+
define_macros=macros,
|
67
|
+
include_dirs=["src"],
|
68
|
+
py_limited_api=limited_api,
|
69
|
+
)
|
70
|
+
],
|
71
|
+
cmdclass={
|
72
|
+
"build": Build,
|
73
|
+
"bdist_wheel": BdistWheel,
|
74
|
+
"egg_info": EggInfo,
|
75
|
+
},
|
76
|
+
zip_safe=False,
|
77
|
+
)
|