Skip to content

Commit

Permalink
build: move metadata to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Feb 25, 2024
1 parent bc59e3c commit 92a8d3b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
29 changes: 27 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
[build-system]
requires = ["setuptools>=43.0.0", "wheel>=0.36.2"]
requires = ["setuptools>=43"]
build-backend = "setuptools.build_meta"

[project]
name = "tree_sitter"
version = "0.21.0"
description = "Python bindings for the Tree-Sitter parsing library"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Python",
"Topic :: Software Development :: Compilers",
"Topic :: Text Processing :: Linguistic",
"Typing :: Typed"
]
requires-python = ">=3.8"
readme = "README.md"

[project.urls]
Homepage = "https://tree-sitter.github.io/tree-sitter/"
Source = "https://github.com/tree-sitter/py-tree-sitter"

[[project.authors]]
name = "Max Brunsfeld"
email = "[email protected]"

[tool.ruff]
line-length = 100

[tool.ruff.pycodestyle]
max-line-length = 102
max-line-length = 100
44 changes: 14 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,29 @@
Py-Tree-sitter
"""

from os import path
from platform import system

from setuptools import Extension, setup

with open(path.join(path.dirname(__file__), "README.md")) as f:
LONG_DESCRIPTION = f.read()

setup(
name="tree_sitter",
version="0.20.4",
maintainer="Max Brunsfeld",
maintainer_email="[email protected]",
author="Max Brunsfeld",
author_email="[email protected]",
url="https://github.com/tree-sitter/py-tree-sitter",
license="MIT",
platforms=["any"],
python_requires=">=3.3",
description="Python bindings for the Tree-Sitter parsing library",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
classifiers=[
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Compilers",
"Topic :: Text Processing :: Linguistic",
],
install_requires=["setuptools>=60.0.0; python_version>='3.12'"],
packages=["tree_sitter"],
package_data={"tree_sitter": ["py.typed", "*.pyi"]},
package_data={
"tree_sitter": ["py.typed", "*.pyi"]
},
ext_modules=[
Extension(
"tree_sitter.binding",
["tree_sitter/core/lib/src/lib.c", "tree_sitter/binding.c"],
include_dirs=["tree_sitter/core/lib/include", "tree_sitter/core/lib/src"],
name="tree_sitter.binding",
sources=[
"tree_sitter/core/lib/src/lib.c",
"tree_sitter/binding.c"
],
include_dirs=[
"tree_sitter/core/lib/include",
"tree_sitter/core/lib/src"
],
extra_compile_args=(
["-std=c99", "-Wno-unused-variable"] if system() != "Windows" else None
["-std=gnu11", "-Wno-unused-variable"] if system() != "Windows" else None
),
)
],
project_urls={"Source": "https://github.com/tree-sitter/py-tree-sitter"},
]
)

0 comments on commit 92a8d3b

Please sign in to comment.