Skip to content

Commit

Permalink
feat!: update bindings & regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Jun 5, 2024
1 parent e3b82b7 commit 6eff76e
Show file tree
Hide file tree
Showing 37 changed files with 1,376 additions and 422 deletions.
35 changes: 28 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,37 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[grammar.js]
quote_type = single
[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.py]
[*.{py,pyi}]
indent_style = space
indent_size = 4

[README.rst]
indent_size = 3
[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8
10 changes: 9 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
* text eol=lf

src/** linguist-generated
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
27 changes: 8 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,20 @@ concurrency:
cancel-in-progress: true

jobs:
test-parser:
name: Test the parser
test:
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Set up repository
uses: tree-sitter/[email protected]
with:
node-version: ${{vars.NODE_VERSION}}
- name: Run tests
uses: tree-sitter/[email protected]
test-package:
name: Test the Python package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Run parser and binding tests
uses: tree-sitter/parser-test-action@v2
with:
python-version: ${{vars.PYTHON_VERSION}}
- name: Install dependencies
run: pip install .
- name: Run tests
run: test/test_package.py
test-python: true
test-rust: ${{runner.os == 'Linux'}}
42 changes: 34 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
.venv/
*.egg-info/
node_modules/
yarn.lock
# Rust artifacts
Cargo.lock
target/

dist/
# Node artifacts
build/
target/
*.wasm
*.dll
prebuilds/
node_modules/
*.tgz

# Swift artifacts
.build/

# Go artifacts
go.sum
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc

# Example dirs
/examples/*/

# Grammar volatiles
*.wasm
*.obj
*.o
25 changes: 10 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
[package]
name = "tree-sitter-pymanifest"
description = "pymanifest grammar for the tree-sitter parsing library"
version = "0.4.0"
keywords = ["incremental", "parsing", "pymanifest"]
description = "PyPA manifest grammar for tree-sitter"
version = "0.5.0"
license = "MIT"
readme = "README.md"
authors = ["ObserverOfTime <[email protected]>"]
keywords = ["incremental", "parsing", "tree-sitter", "pymanifest"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter-grammars/tree-sitter-pymanifest"
edition = "2021"
license = "MIT"
autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"src/parser.c",
"src/grammar.json",
"src/node-types.json",
"src/tree_sitter/*",
"src/tree_sitter_pymanifest/queries/*",
]
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "~0.20.10"
tree-sitter = ">=0.22.6"

[build-dependencies]
cc = "^1.0"
cc = "1.0.87"
112 changes: 112 additions & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions Package.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 7 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ Installation
pip install tree-sitter-pymanifest
Usage
^^^^^

.. code-block:: python
import tree_sitter_pymanifest as pymanifest
with open('MANIFEST.in', 'r') as mf:
# parse a MANIFEST.in file
tree = pymanifest.parse(mf.read())
# get the highlight groups
hl_groups = pymanifest.highlights(tree)
# run an arbitrary query
dir_patterns = pymanifest.query("""
(command dir_pattern: (pattern) @dir_pattern)
""", tree.root_node)
References
----------
Expand All @@ -55,6 +38,13 @@ Editors
Changelog
---------

v0.5.0
^^^^^^

* Update bindings
* Remove custom functions
* Drop Python 3.8 support

v0.4.0
^^^^^^

Expand Down
Loading

0 comments on commit 6eff76e

Please sign in to comment.