mycli icon indicating copy to clipboard operation
mycli copied to clipboard

Remove click<8.1.8 version limit

Open wrmsr opened this issue 6 months ago • 3 comments

Description

click was set to <8.1.8 in bb18b0c2f2ed7375efe31d379e616a11c82b1299 in #1200 due to this test run failing - I'm just wondering if it's still failing on more recent versions, so I'm posting this as a draft to run the tests. I tried and failed to reproduce it locally.

Checklist

  • [ ] I've added this contribution to the changelog.md.
  • [ ] I've added my name to the AUTHORS file (or it's already there).

wrmsr avatar Jun 13 '25 17:06 wrmsr

It would be great to have some bisecting done to narrow down the problem. I took a look at the most likely parts of the click source and didn't see recent suspect changes.

rolandwalker avatar Jun 14 '25 16:06 rolandwalker

Reproducing it locally, narrowed it down to 299efb82e1a3d34d870129dc0c677c6efb42d811 but haven't investigated more as I'm unfamiliar with all this machinery lol.

wrmsr avatar Jun 17 '25 05:06 wrmsr

Ah, that's very helpful!

rolandwalker avatar Jun 17 '25 16:06 rolandwalker

@wrmsr your analysis is great, thanks! I tried out a different idea in #1305, and the tests pass. My bumbling with env variables in #1241 was never going to work.

However, the tests were telling us something! We allow setting a pager in the config file with arguments:

pager = 'less -iRSMwF --use-color'

and that is going to break with the new click, right?

rolandwalker avatar Aug 06 '25 12:08 rolandwalker

@rolandwalker >_< forgot to close the mkstemp fd, seems like linux won't exec an open-for-write file. Tested locally on 🍎 and 🐧 and it passes. Mind rerunning to confirm?

Not saying this is the proper fix if a configurable multi-token 'shelly' pager command is supported. At least for the very first breaking click version - the one with the diff I linked - I don't think that's doable without moving this kind of hack into mycli since the whole thing is shlex.which'd. However it seems on modern clicks - since 3/27 (8.2.0?) - it tries to shlex.split the pager env var and shutil.which only the first word, which looking at it should work, and yet didn't when I initially posted this branch with the latest click version. There's surely a way to get it working under that, I'll look at that later.

wrmsr avatar Aug 06 '25 18:08 wrmsr

However it seems on modern clicks - since 3/27 (8.2.0?) - it tries to shlex.split the pager env var

Great! Then we only have to blocklist some range of versions.

rolandwalker avatar Aug 06 '25 20:08 rolandwalker

Do you need me to handle the lint fixes?

rolandwalker avatar Aug 15 '25 10:08 rolandwalker

I opened an issue with click based on your research: https://github.com/pallets/click/issues/3039

rolandwalker avatar Aug 16 '25 10:08 rolandwalker

Closing in favor of #1396, after a click release containing the bugfix. Many thanks @wrmsr !

rolandwalker avatar Nov 15 '25 21:11 rolandwalker