Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: PyPi package #42

Open
1 task done
domWalters opened this issue Feb 25, 2025 · 7 comments
Open
1 task done

feature: PyPi package #42

domWalters opened this issue Feb 25, 2025 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@domWalters
Copy link

domWalters commented Feb 25, 2025

Did you check the tree-sitter docs?

Is your feature request related to a problem? Please describe.

I'd like to be able to install the Python bindings from PyPi using pip.

Describe the solution you'd like

I'd like the python bindings for the package to be hosted on PyPi.

Describe alternatives you've considered

I don't believe that I have an alternative.

I am developing a Python application that I'd like to host on PyPi at some point. To be able to do this, all dependencies of the package must also be downloadable from PyPi. I would like to / will need to use tree-sitter-vhdl.

Additional context

Thank you for this tree-sitter. I used to use alemullers version in neovim until it completely broke. Had no issues with yours yet 😄

@domWalters domWalters added the enhancement New feature or request label Feb 25, 2025
@jpt13653903
Copy link
Owner

I don't actually know how to do this...

Can you give me some pointers / point me to some docs?

@jpt13653903 jpt13653903 self-assigned this Feb 25, 2025
@jpt13653903
Copy link
Owner

For my own future reference...

I'll read these sources later to try and figure it out. Don't expect it to happen soon -- my life is a touch chaotic for the next few weeks.

If you can issue a PR with the required updates to the various package files and stuff that'll be a great start. The tree-sitter CLI auto-generates the Python bindings, but they look a little... incomplete. I think I need to link in the queries, etc...?

@domWalters
Copy link
Author

domWalters commented Feb 25, 2025

I was able to use the bindings straight up with very little change I think.

Let me have a mess around and get back to you.


As some additional references, I have a different project which I already publish to PyPi here:

https://gitlab.com/dawalters/ocpiupdate

You can see how I do the publishing in these locations:


I don't know if there are any changes that need to be made to pyproject.toml. I'll see if I can find another tree-sitter as an example.

@jpt13653903
Copy link
Owner

I like the GitHub CI option...
I'll give it a go over the weekend

@domWalters
Copy link
Author

domWalters commented Feb 25, 2025

Here's a quick test I threw together: https://github.com/domWalters/tree-sitter-vhdl-test

Just:

# Tested with Python 3.13

# This is self contained; deleting the `tree-sitter-vhdl-test` directory will remove everything this script does
git clone https://github.com/domWalters/tree-sitter-vhdl-test.git
cd tree-sitter-vhdl-test
./run-test.sh

If everything works, you should see the tree-sitter parse tree of the test.vhd file printed to the terminal.

If something goes wrong, running setup.sh will remake everything but save the node_modules folder so it doesn't need redownloading.

I have to regenerate your repo in the setup.sh script for --abi 14, as the most recent repo tag (v.1.2.4) still has the ABI set to 15 (your reversion isn't on a tagged release yet).

@jpt13653903
Copy link
Owner

Thanks
And thanks also for the reminder to move the tag - that ABI 15 build was a mistake

@jpt13653903
Copy link
Owner

I'll see if I can find another tree-sitter as an example.

tree-sitter-arduino looks like a promising example -- I'll go see what it's done...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants