kislyuk / argcomplete

Python and tab completion, better together.
https://kislyuk.github.io/argcomplete/
Apache License 2.0
1.39k stars 129 forks source link

Switch to entry points and pure pyproject.toml config #474

Closed segevfiner closed 3 weeks ago

segevfiner commented 4 months ago

See https://github.com/pypa/pipx/issues/1230 & https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#scripts

segevfiner commented 4 months ago

@kislyuk

kislyuk commented 4 months ago

Sorry, I don't think we need this at this point. Is there a specific problem that you are trying to solve with this? If so, please describe the complete steps to reproduce it.

segevfiner commented 4 months ago

See the linked issue: https://github.com/pypa/pipx/issues/1230

I'm basically unable to use this on macOS due to that.

kislyuk commented 4 months ago

So you are unable to use argcomplete because of a bug in pipx where it's unable to use setuptools scripts when the absolute path to the script contains spaces?

segevfiner commented 4 months ago

Yeah. And Homebrew Python started to force pipx.

kislyuk commented 3 months ago

I plan to do some testing this weekend and see what I can do about this.

kislyuk commented 3 weeks ago

Sorry, I don't think we will be able to merge this PR.

segevfiner commented 1 week ago

@kislyuk Are you sure? Doing this will also allow this to work correctly in Windows...

evanunderscore commented 1 week ago

We also have other long-standing issues related to the use of plain scripts that would probably be fixed by this. I'm not up to date with pyproject.toml but a long time ago I proposed moving these to console_scripts which I assume is the same thing.

I originally wrote https://github.com/evanunderscore/argcomplete/commits/dynamic-test-shebang to address #255 but the change was never pursued as the person who reported the problem never tested it to verify it addressed their issue. If there is no specific reason to avoid making this change, it would probably be for the better and avoid more issues like this in future.

kislyuk commented 2 days ago

@evanunderscore the primary reason this PR was rejected was because it tried to do too many things at the same time, causing me to lose confidence in my ability to review it and in the PR's ability to prove its correctness.

I think migrating to console_scripts is a reasonable move on its own, provided that it's done cleanly and in a staged manner that preserves the ability to review lines of scripts (e.g. first PR transforms the scripts to the format to be used by console_scripts, second PR moves the script file to its desired location and reconfigures setup.py; a separate PR may propose changes to pyproject.toml).

kislyuk commented 2 days ago

@segevfiner as described in the documentation (https://github.com/kislyuk/argcomplete?tab=readme-ov-file#support-for-other-shells), windows is not directly supported by argcomplete. Only WSL is supported.

segevfiner commented 2 days ago

@segevfiner as described in the documentation (https://github.com/kislyuk/argcomplete?tab=readme-ov-file#support-for-other-shells), windows is not directly supported by argcomplete. Only WSL is supported.

I'm not sure if any other changes then the console_scripts thing is needed though to support it.

I can split up this PR to separate PRs (Or commits, some prefer one PR with separate commits).

kislyuk commented 2 days ago

A change to project policy would be needed, and that is outside the scope of this PR.

OK, please split into separate PRs including at least 3 stages as I outlined. I do not want to have one PR incorporating these changes.