Skip to content

Commit d3e1d2e

Browse files
committed
Try with pyproject.toml
1 parent a636602 commit d3e1d2e

File tree

6 files changed

+82
-55
lines changed

6 files changed

+82
-55
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Build wheels
3535
run: uvx [email protected] --output-dir dist
3636
env:
37-
CIBW_BEFORE_BUILD: pip install --upgrade Cython==3.0.11 && pip install -e . && python build.py
37+
CIBW_BEFORE_BUILD: pip install -e . && python build.py
3838
CIBW_TEST_REQUIRES: pytest
3939
CIBW_TEST_COMMAND: pytest --showlocals {package}/tests
4040
CIBW_SKIP: "{pp*}"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Install
2525

2626
::
2727

28-
pip install tree_sitter_languages
28+
pip install textual_tree_sitter_languages
2929

3030
Source installs are not supported. To see how the binary wheels are built, look
3131
at:
@@ -47,7 +47,7 @@ Usage
4747

4848
.. code:: python
4949
50-
from tree_sitter_languages import get_language, get_parser
50+
from textual_tree_sitter_languages import get_language, get_parser
5151
5252
language = get_language('python')
5353
parser = get_parser('python')

_old_setup.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# import pathlib
2+
# import re
3+
# import setuptools
4+
5+
# from Cython.Build import cythonize
6+
7+
# init = (pathlib.Path("tree_sitter_languages") / "__init__.py").read_text()
8+
# match = re.search(r"^__version__ = \"(.+)\"$", init, re.MULTILINE)
9+
# version = match.group(1)
10+
11+
# with open("README.rst") as reader:
12+
# readme = reader.read()
13+
14+
# setuptools.setup(
15+
# name="textual_tree_sitter_languages",
16+
# version=version,
17+
# description="Binary Python wheels for all tree sitter languages.",
18+
# long_description=readme,
19+
# author="Textualize",
20+
# author_email="[email protected]",
21+
# url="https://github.com/Textualize/py-tree-sitter-languages",
22+
# license="Apache 2.0",
23+
# ext_modules=cythonize("tree_sitter_languages/core.pyx", language_level="3"),
24+
# packages=["tree_sitter_languages"],
25+
# package_data={"tree_sitter_languages": ["languages.so", "languages.dll"]},
26+
# install_requires=["tree-sitter<0.22.0"],
27+
# python_requires=">=3.8",
28+
# project_urls={
29+
# "Documentation": "https://github.com/Textualize/py-tree-sitter-languages",
30+
# "Source": "https://github.com/Textualize/py-tree-sitter-languages",
31+
# "Tracker": "https://github.com/Textualize/py-tree-sitter-languages/issues",
32+
# },
33+
# classifiers=[
34+
# "Development Status :: 5 - Production/Stable",
35+
# "Intended Audience :: Developers",
36+
# "License :: OSI Approved :: Apache Software License",
37+
# "Natural Language :: English",
38+
# "Programming Language :: Python",
39+
# "Programming Language :: Python :: 3",
40+
# "Programming Language :: Python :: Implementation :: CPython",
41+
# ],
42+
# )

pyproject.toml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
[project]
2+
name = "textual_tree_sitter_languages"
3+
version = "1.11.0"
4+
description = "Binary Python wheels for popular tree sitter languages."
5+
authors = [
6+
{name = "Textualize", email = "[email protected]"},
7+
]
28
requires-python = ">= 3.8"
9+
readme = "README.rst"
10+
license = {text = "Apache 2.0"}
11+
dependencies = ["tree-sitter<0.22.0"]
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: Apache Software License",
16+
"Natural Language :: English",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: Implementation :: CPython",
20+
]
21+
22+
[project.urls]
23+
Documentation = "https://github.com/Textualize/py-tree-sitter-languages"
24+
Source = "https://github.com/Textualize/py-tree-sitter-languages"
25+
Tracker = "https://github.com/Textualize/py-tree-sitter-languages/issues"
326

427
[build-system]
528
requires = [
629
"setuptools>=42",
730
"Cython",
831
]
32+
build-backend = "setuptools.build_meta"
33+
34+
[tool.setuptools]
35+
packages = ["tree_sitter_languages"]
36+
package-data = {"tree_sitter_languages" = ["languages.so", "languages.dll"]}
37+
38+
[tool.setuptools.ext_modules]
39+
tree_sitter_languages = {sources = ["tree_sitter_languages/core.pyx"]}
940

10-
build-backend = "setuptools.build_meta"
41+
[tool.cython]
42+
language_level = "3"

setup.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

tree_sitter_languages/__init__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
"""Tree Sitter with Languages"""
2-
3-
from .core import get_language, get_parser
4-
5-
__version__ = "1.11.0"
6-
__title__ = "textual_tree_sitter_languages"
7-
__author__ = "Grant Jenks"
8-
__license__ = "Apache 2.0"
9-
__copyright__ = "2022-2024, Grant Jenks"
1+
"""
2+
Binary wheels for tree-sitter for several common languages.
3+
Does not support tree-sitter v0.22.0 and above.
4+
"""

0 commit comments

Comments
 (0)