astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
27.98k stars 803 forks source link

Can't run some scripts on Windows with `uv tool run` #8888

Open depau opened 3 weeks ago

depau commented 3 weeks ago

uv version: uv 0.4.30 (61ed2a236 2024-11-04)

awslocal on Windows doesn't seem to work properly with uv tool run --from awscli-local awslocal

The executable `awslocal` was not found.
warning: An executable named `awslocal` is not provided by package `awscli-local`.
The following executables are provided by `awscli-local`:
- awslocal
- awslocal.bat
Consider using `uv tool run --from awscli-local <EXECUTABLE_NAME>` instead.

The awslocal file is actually a script:

#!python.exe

"""
Thin wrapper around the "aws" command line interface (CLI) for use
with LocalStack.
...

while for other tools it looks like a .exe is installed, which seems to work with uv.

This is probably caused by the fact that they provide the entry scripts as a path to file, not as module:function.

Using the provided .bat file does work, but it requires providing a different executable name based on the current OS and it looks like python detaches from the terminal when run from a batch script.

I'm not sure whether this is a problem with awslocal or uv. I thought I'd report it here first since this usage of setuptools seems legit.

charliermarsh commented 2 weeks ago

Thanks! Makes sense to report it here. We'll take a look.

samypr100 commented 2 weeks ago

I think this is expected/known to fail due to their use of legacy scripts rather than console_scripts.

Related:

zanieb commented 2 weeks ago

I think we should probably special case them if it's feasible.