From 92a8d3bcbb0b6b83f614b09f5086643cc8237831 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 25 Feb 2024 18:07:35 +0200 Subject: [PATCH] build: move metadata to pyproject.toml --- pyproject.toml | 29 +++++++++++++++++++++++++++-- setup.py | 44 ++++++++++++++------------------------------ 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b8d7afb..1a9f1ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "maxbrunsfeld@gmail.com" + [tool.ruff] line-length = 100 [tool.ruff.pycodestyle] -max-line-length = 102 +max-line-length = 100 diff --git a/setup.py b/setup.py index d75bbde..1682d5a 100644 --- a/setup.py +++ b/setup.py @@ -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="maxbrunsfeld@gmail.com", - author="Max Brunsfeld", - author_email="maxbrunsfeld@gmail.com", - 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"}, + ] )