tree-sitter-python-orchard 0.4.2__tar.gz → 0.5.0__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.
Files changed (28) hide show
  1. tree_sitter_python_orchard-0.5.0/PKG-INFO +50 -0
  2. tree_sitter_python_orchard-0.5.0/README.md +31 -0
  3. tree_sitter_python_orchard-0.5.0/bindings/python/tree_sitter_python_orchard/__init__.py +43 -0
  4. tree_sitter_python_orchard-0.5.0/bindings/python/tree_sitter_python_orchard/__init__.pyi +17 -0
  5. tree_sitter_python_orchard-0.5.0/bindings/python/tree_sitter_python_orchard.egg-info/PKG-INFO +50 -0
  6. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/pyproject.toml +1 -1
  7. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/setup.py +2 -1
  8. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/src/parser.c +65214 -63977
  9. tree_sitter_python_orchard-0.5.0/src/scanner.c +443 -0
  10. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/src/tree_sitter/array.h +118 -73
  11. tree-sitter-python-orchard-0.4.2/PKG-INFO +0 -30
  12. tree-sitter-python-orchard-0.4.2/README.md +0 -13
  13. tree-sitter-python-orchard-0.4.2/bindings/python/tree_sitter_python_orchard/__init__.py +0 -42
  14. tree-sitter-python-orchard-0.4.2/bindings/python/tree_sitter_python_orchard/__init__.pyi +0 -10
  15. tree-sitter-python-orchard-0.4.2/bindings/python/tree_sitter_python_orchard.egg-info/PKG-INFO +0 -30
  16. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/LICENSE +0 -0
  17. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard/binding.c +0 -0
  18. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard/py.typed +0 -0
  19. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard.egg-info/SOURCES.txt +0 -0
  20. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard.egg-info/dependency_links.txt +0 -0
  21. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard.egg-info/not-zip-safe +0 -0
  22. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard.egg-info/requires.txt +0 -0
  23. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/bindings/python/tree_sitter_python_orchard.egg-info/top_level.txt +0 -0
  24. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/queries/highlights.scm +0 -0
  25. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/queries/tags.scm +0 -0
  26. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/setup.cfg +0 -0
  27. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/src/tree_sitter/alloc.h +0 -0
  28. {tree-sitter-python-orchard-0.4.2 → tree_sitter_python_orchard-0.5.0}/src/tree_sitter/parser.h +0 -0
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-sitter-python-orchard
3
+ Version: 0.5.0
4
+ Summary: Parser for Python files
5
+ Author-email: Max Brunsfeld <maxbrunsfeld@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://codeberg.org/grammar-orchard/tree-sitter-python-orchard
8
+ Keywords: incremental,parsing,tree-sitter,python-orchard
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
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.24; extra == "core"
18
+ Dynamic: license-file
19
+
20
+ # tree-sitter-python-orchard
21
+
22
+ [![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
23
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
24
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
25
+
26
+ This is a tree-sitter grammar for Python.
27
+
28
+ ### Using it
29
+
30
+ You can obtain this parser in various formats:
31
+ * as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
32
+ * as a Rust crate: `cargo add tree-sitter-python-orchard`
33
+ * as a Python package: `pip install tree-sitter-python-orchard`
34
+ * as an NPM package: `npm install tree-sitter-python-orchard`
35
+
36
+ ### Contributing
37
+
38
+ Contributions are welcome, so are co-maintainers.
39
+
40
+ Unlike many grammar repositories, this one does not track generated files.
41
+ After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
42
+ If you want to use it via bindings, you'll also need to run `tree-sitter init`.
43
+
44
+ ### Origin
45
+
46
+ This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
47
+
48
+ [crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
49
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
50
+ [npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
@@ -0,0 +1,31 @@
1
+ # tree-sitter-python-orchard
2
+
3
+ [![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
4
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
5
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
6
+
7
+ This is a tree-sitter grammar for Python.
8
+
9
+ ### Using it
10
+
11
+ You can obtain this parser in various formats:
12
+ * as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
13
+ * as a Rust crate: `cargo add tree-sitter-python-orchard`
14
+ * as a Python package: `pip install tree-sitter-python-orchard`
15
+ * as an NPM package: `npm install tree-sitter-python-orchard`
16
+
17
+ ### Contributing
18
+
19
+ Contributions are welcome, so are co-maintainers.
20
+
21
+ Unlike many grammar repositories, this one does not track generated files.
22
+ After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
23
+ If you want to use it via bindings, you'll also need to run `tree-sitter init`.
24
+
25
+ ### Origin
26
+
27
+ This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
28
+
29
+ [crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
30
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
31
+ [npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
@@ -0,0 +1,43 @@
1
+ """Parser for Python files"""
2
+
3
+ from importlib.resources import files as _files
4
+
5
+ from ._binding import language
6
+
7
+
8
+ def _get_query(name, file):
9
+ try:
10
+ query = _files(f"{__package__}") / file
11
+ globals()[name] = query.read_text()
12
+ except FileNotFoundError:
13
+ globals()[name] = None
14
+ return globals()[name]
15
+
16
+
17
+ def __getattr__(name):
18
+ if name == "HIGHLIGHTS_QUERY":
19
+ return _get_query("HIGHLIGHTS_QUERY", "queries/highlights.scm")
20
+ if name == "INJECTIONS_QUERY":
21
+ return _get_query("INJECTIONS_QUERY", "queries/injections.scm")
22
+ if name == "LOCALS_QUERY":
23
+ return _get_query("LOCALS_QUERY", "queries/locals.scm")
24
+ if name == "TAGS_QUERY":
25
+ return _get_query("TAGS_QUERY", "queries/tags.scm")
26
+
27
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
28
+
29
+
30
+ __all__ = [
31
+ "language",
32
+ "HIGHLIGHTS_QUERY",
33
+ "INJECTIONS_QUERY",
34
+ "LOCALS_QUERY",
35
+ "TAGS_QUERY",
36
+ ]
37
+
38
+
39
+ def __dir__():
40
+ return sorted(__all__ + [
41
+ "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
42
+ "__loader__", "__name__", "__package__", "__path__", "__spec__",
43
+ ])
@@ -0,0 +1,17 @@
1
+ from typing import Final
2
+ from typing_extensions import CapsuleType
3
+
4
+ HIGHLIGHTS_QUERY: Final[str] | None
5
+ """The syntax highlighting query for this grammar."""
6
+
7
+ INJECTIONS_QUERY: Final[str] | None
8
+ """The language injection query for this grammar."""
9
+
10
+ LOCALS_QUERY: Final[str] | None
11
+ """The local variable query for this grammar."""
12
+
13
+ TAGS_QUERY: Final[str] | None
14
+ """The symbol tagging query for this grammar."""
15
+
16
+ def language() -> CapsuleType:
17
+ """The tree-sitter language function for this grammar."""
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-sitter-python-orchard
3
+ Version: 0.5.0
4
+ Summary: Parser for Python files
5
+ Author-email: Max Brunsfeld <maxbrunsfeld@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://codeberg.org/grammar-orchard/tree-sitter-python-orchard
8
+ Keywords: incremental,parsing,tree-sitter,python-orchard
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
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.24; extra == "core"
18
+ Dynamic: license-file
19
+
20
+ # tree-sitter-python-orchard
21
+
22
+ [![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
23
+ [![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
24
+ [![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
25
+
26
+ This is a tree-sitter grammar for Python.
27
+
28
+ ### Using it
29
+
30
+ You can obtain this parser in various formats:
31
+ * as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
32
+ * as a Rust crate: `cargo add tree-sitter-python-orchard`
33
+ * as a Python package: `pip install tree-sitter-python-orchard`
34
+ * as an NPM package: `npm install tree-sitter-python-orchard`
35
+
36
+ ### Contributing
37
+
38
+ Contributions are welcome, so are co-maintainers.
39
+
40
+ Unlike many grammar repositories, this one does not track generated files.
41
+ After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
42
+ If you want to use it via bindings, you'll also need to run `tree-sitter init`.
43
+
44
+ ### Origin
45
+
46
+ This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
47
+
48
+ [crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
49
+ [pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
50
+ [npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "tree-sitter-python-orchard"
7
7
  description = "Parser for Python files"
8
- version = "0.4.2"
8
+ version = "0.5.0"
9
9
  keywords = ["incremental", "parsing", "tree-sitter", "python-orchard"]
10
10
  classifiers = [
11
11
  "Intended Audience :: Developers",
@@ -32,7 +32,7 @@ class BuildExt(build_ext):
32
32
  class BdistWheel(bdist_wheel):
33
33
  def get_tag(self):
34
34
  python, abi, platform = super().get_tag()
35
- if python.startswith("cp"):
35
+ if python.startswith("cp") and not get_config_var("Py_GIL_DISABLED"):
36
36
  python, abi = "cp310", "abi3"
37
37
  return python, abi, platform
38
38
 
@@ -42,6 +42,7 @@ class EggInfo(egg_info):
42
42
  super().find_sources()
43
43
  self.filelist.recursive_include("queries", "*.scm")
44
44
  self.filelist.include("src/tree_sitter/*.h")
45
+ self.filelist.include("src/*.c")
45
46
 
46
47
 
47
48
  setup(