argcomplete icon indicating copy to clipboard operation
argcomplete copied to clipboard

Switch to entry points and pure pyproject.toml config

Open segevfiner opened this issue 11 months ago • 6 comments

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

segevfiner avatar Feb 26 '24 11:02 segevfiner

@kislyuk

segevfiner avatar Mar 03 '24 18:03 segevfiner

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.

kislyuk avatar Mar 03 '24 22:03 kislyuk

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

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

segevfiner avatar Mar 03 '24 22:03 segevfiner

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?

kislyuk avatar Mar 03 '24 23:03 kislyuk

Yeah. And Homebrew Python started to force pipx.

segevfiner avatar Mar 03 '24 23:03 segevfiner

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

kislyuk avatar Mar 08 '24 01:03 kislyuk

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

kislyuk avatar Jun 12 '24 00:06 kislyuk

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

segevfiner avatar Jun 22 '24 07:06 segevfiner

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.

evanunderscore avatar Jun 23 '24 04:06 evanunderscore

@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 avatar Jun 30 '24 06:06 kislyuk

@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.

kislyuk avatar Jun 30 '24 06:06 kislyuk

@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).

segevfiner avatar Jun 30 '24 06:06 segevfiner

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.

kislyuk avatar Jun 30 '24 06:06 kislyuk