Skip to content

Commit

Permalink
Try with pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Nov 28, 2024
1 parent a636602 commit d3e1d2e
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Build wheels
run: uvx [email protected] --output-dir dist
env:
CIBW_BEFORE_BUILD: pip install --upgrade Cython==3.0.11 && pip install -e . && python build.py
CIBW_BEFORE_BUILD: pip install -e . && python build.py
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --showlocals {package}/tests
CIBW_SKIP: "{pp*}"
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Install

::

pip install tree_sitter_languages
pip install textual_tree_sitter_languages

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

.. code:: python
from tree_sitter_languages import get_language, get_parser
from textual_tree_sitter_languages import get_language, get_parser
language = get_language('python')
parser = get_parser('python')
Expand Down
42 changes: 42 additions & 0 deletions _old_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# import pathlib
# import re
# import setuptools

# from Cython.Build import cythonize

# init = (pathlib.Path("tree_sitter_languages") / "__init__.py").read_text()
# match = re.search(r"^__version__ = \"(.+)\"$", init, re.MULTILINE)
# version = match.group(1)

# with open("README.rst") as reader:
# readme = reader.read()

# setuptools.setup(
# name="textual_tree_sitter_languages",
# version=version,
# description="Binary Python wheels for all tree sitter languages.",
# long_description=readme,
# author="Textualize",
# author_email="[email protected]",
# url="https://github.com/Textualize/py-tree-sitter-languages",
# license="Apache 2.0",
# ext_modules=cythonize("tree_sitter_languages/core.pyx", language_level="3"),
# packages=["tree_sitter_languages"],
# package_data={"tree_sitter_languages": ["languages.so", "languages.dll"]},
# install_requires=["tree-sitter<0.22.0"],
# python_requires=">=3.8",
# project_urls={
# "Documentation": "https://github.com/Textualize/py-tree-sitter-languages",
# "Source": "https://github.com/Textualize/py-tree-sitter-languages",
# "Tracker": "https://github.com/Textualize/py-tree-sitter-languages/issues",
# },
# classifiers=[
# "Development Status :: 5 - Production/Stable",
# "Intended Audience :: Developers",
# "License :: OSI Approved :: Apache Software License",
# "Natural Language :: English",
# "Programming Language :: Python",
# "Programming Language :: Python :: 3",
# "Programming Language :: Python :: Implementation :: CPython",
# ],
# )
34 changes: 33 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
[project]
name = "textual_tree_sitter_languages"
version = "1.11.0"
description = "Binary Python wheels for popular tree sitter languages."
authors = [
{name = "Textualize", email = "[email protected]"},
]
requires-python = ">= 3.8"
readme = "README.rst"
license = {text = "Apache 2.0"}
dependencies = ["tree-sitter<0.22.0"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
]

[project.urls]
Documentation = "https://github.com/Textualize/py-tree-sitter-languages"
Source = "https://github.com/Textualize/py-tree-sitter-languages"
Tracker = "https://github.com/Textualize/py-tree-sitter-languages/issues"

[build-system]
requires = [
"setuptools>=42",
"Cython",
]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["tree_sitter_languages"]
package-data = {"tree_sitter_languages" = ["languages.so", "languages.dll"]}

[tool.setuptools.ext_modules]
tree_sitter_languages = {sources = ["tree_sitter_languages/core.pyx"]}

build-backend = "setuptools.build_meta"
[tool.cython]
language_level = "3"
42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

13 changes: 4 additions & 9 deletions tree_sitter_languages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""Tree Sitter with Languages"""

from .core import get_language, get_parser

__version__ = "1.11.0"
__title__ = "textual_tree_sitter_languages"
__author__ = "Grant Jenks"
__license__ = "Apache 2.0"
__copyright__ = "2022-2024, Grant Jenks"
"""
Binary wheels for tree-sitter for several common languages.
Does not support tree-sitter v0.22.0 and above.
"""

0 comments on commit d3e1d2e

Please sign in to comment.