Giter Club home page Giter Club logo

py-tree-sitter-builds's Introduction

py-tree-sitter-builds

The py-tree-sitter project (not to be confused with tree-sitter-python) provides Python bindings for the awesome tree-sitter parsing library. The documentation of py-tree-sitter says that you need to have a C compiler installed to use it, but installing a C compiler can be highly non-trivial depending on which operating system you have. It's also a huge dependency for what is otherwise a small and simple parsing library.

This project lets you use py-tree-sitter without a C compiler by providing binary wheels that were built using a C compiler, but don't require a C compiler to be installed. The wheels contain:

Installation

$ pip install tree-sitter-builds

After installing, import tree_sitter and import tree_sitter_languages should work. For documentation, see the documentation of:

How does it work?

Read .github/workflows/build.yml to see how GitHub actions builds the wheels. Here are the steps, at a high level:

  • Download py-tree-sitter v0.20.1 and py-tree-sitter-languages v1.5.0 from GitHub (these are the latest released versions at the time of writing this)
  • Move downloaded files to the correct places, so that the resulting wheels will contain both tree_sitter and tree_sitter_languages
  • Apply patches to the tests of tree_sitter and tree_sitter_languages so that they work here
  • Invoke cibuildwheel with the same configuration as py-tree-sitter-languages uses
  • Once the above steps have ran on Windows, MacOS and Linux, upload the wheels to PyPI

License

The wheels consist of various parts licensed under MIT and Apache 2.0 licenses:

py-tree-sitter-builds's People

Contributors

akuli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.