tree-sitter icon indicating copy to clipboard operation
tree-sitter copied to clipboard

fix(cli): require correct setuptools version

Open rabbiveesh opened this issue 5 months ago • 13 comments

The build process uses the module setuptools.command.build which was added in 62.4.0 as per https://github.com/pypa/setuptools/blob/main/NEWS.rst#v6240

also ref https://github.com/tree-sitter-perl/tree-sitter-perl/issues/214

rabbiveesh avatar Jun 06 '25 08:06 rabbiveesh

From what I understand when you declare like I did the pip will install the build deps in a temporary env; so I'm not sure there's benefit to implementing fallback

rabbiveesh avatar Jun 06 '25 14:06 rabbiveesh

Not if you use the system packages.

ObserverOfTime avatar Jun 06 '25 14:06 ObserverOfTime

Can you please rebase?

clason avatar Jun 07 '25 10:06 clason

Can we merge #4493 instead?

ObserverOfTime avatar Jun 07 '25 12:06 ObserverOfTime

Why? This is a much simpler fix for the actual issue, and 62.4.0 was released three years ago.

clason avatar Jun 07 '25 12:06 clason

The bdist_wheel command also needs a fallback since the setuptools version was introduced in v70.1.0 which is too recent. We might as well have a fallback for the build command too in that case.

ObserverOfTime avatar Jun 07 '25 12:06 ObserverOfTime

I agree with @clason. I would like the bindings to stay simple; I don’t think it’s worth adding the fallback scheme to support people who do not want to install recent versions of setup tools.

maxbrunsfeld avatar Jun 08 '25 05:06 maxbrunsfeld

Then should we bump all the way to v70.1.0?

ObserverOfTime avatar Jun 08 '25 05:06 ObserverOfTime

Then should we bump all the way to v70.1.0?

Why? What will that buy us over 62.4.0?

clason avatar Jun 08 '25 09:06 clason

Adopted the bdist_wheel command from the wheel project

ObserverOfTime avatar Jun 08 '25 09:06 ObserverOfTime

We could also just keep using the wheel library directly, right? I don't have a strong opinion on that one. Wheel is not deprecated like distutils is. @ObserverOfTime what do you think about this PR's current approach of just upgrading setuptools and keeping wheel?

maxbrunsfeld avatar Jun 08 '25 16:06 maxbrunsfeld

The package isn't deprecated but the bdist_wheel import is. And switching to the setuptools version will allow us to drop wheel from requires.

ObserverOfTime avatar Jun 08 '25 19:06 ObserverOfTime

Do we have a conclusion here? I'm happy to pull in latest master and bump further to 70 whatever as needed. Could I get a clarification for exactly when the install would fail, btw? I didn't quite get the case (I assume it's my ignorance)

rabbiveesh avatar Jun 13 '25 10:06 rabbiveesh

Let's start with a simple rebase(!) on master. If it fixes a concrete problem, we can merge and backport quickly and then iterate further (if and when someone comes up with an actual problem that can be verified to be solved).

clason avatar Jun 26 '25 13:06 clason

K, i have rebased and force-pushed and its all clean. The version that i've bumped to does solve a concrete problem, so i'd love to see this merged

rabbiveesh avatar Jun 27 '25 10:06 rabbiveesh

Successfully created backport PR for release-0.25:

  • #4543

tree-sitter-ci-bot[bot] avatar Jun 27 '25 12:06 tree-sitter-ci-bot[bot]