Skip to content

Commit

Permalink
Refactor package structure and update tests
Browse files Browse the repository at this point in the history
- Updated the package name in pyproject.toml for the Cython extension to "tree_sitter_languages.core".
- Added a new __init__.py file in the tests directory.
- Removed "perl" from the LANGUAGES list in test_tree_sitter_languages.py.
- Adjusted import statements in tree_sitter_languages/__init__.py to reflect the new package structure and defined __all__ for public API.

These changes improve the organization and clarity of the package structure and tests.
  • Loading branch information
darrenburns committed Nov 28, 2024
1 parent 0be0da2 commit ad0184e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build-backend = "setuptools.build_meta"
packages = ["tree_sitter_languages"]
package-data = {"tree_sitter_languages" = ["languages.so", "languages.dll"]}
ext-modules = [
{name = "tree_sitter_languages", sources = ["tree_sitter_languages/core.pyx"]}
{name = "tree_sitter_languages.core", sources = ["tree_sitter_languages/core.pyx"]}
]

[tool.cython]
Expand Down
Empty file added tests/__init__.py
Empty file.
1 change: 0 additions & 1 deletion tests/test_tree_sitter_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"markdown",
"objc",
"ocaml",
"perl",
"php",
"python",
"ql",
Expand Down
4 changes: 3 additions & 1 deletion tree_sitter_languages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
Does not support tree-sitter v0.22.0 and above.
"""

from .core import get_language, get_parser
from tree_sitter_languages.core import get_language, get_parser

__all__ = ["get_language", "get_parser"]

0 comments on commit ad0184e

Please sign in to comment.