astral-sh / uv

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

Build pyproject-build.exe not provided #6682

Open lambda-science opened 2 weeks ago

lambda-science commented 2 weeks ago

From the docs: https://docs.astral.sh/uv/guides/publish/#building-your-package Build your package with the official build frontend: uvx --from build pyproject-build --installer uv

My output:

cmeyer@LPF2LY4JD MINGW64 ~/code-project/project-pythia/pythia-client (main)
$ uvx --from build pyproject-build --installer uv
The executable `pyproject-build` was not found.
warning: An executable named `pyproject-build` is not provided by package `build`.
The following executables are provided by `build`:
- pyproject-build.exe

cmeyer@LPF2LY4JD MINGW64 ~/code-project/project-pythia/pythia-client (main)
$ uvx --from build pyproject-build.exe --installer uv
The executable `pyproject-build.exe` was not found.
warning: An executable named `pyproject-build.exe` is not provided by package `build`.
The following executables are provided by `build`:
- pyproject-build.exe

I don't understand, it was working few days ago. The error is not helpful

zanieb commented 2 weeks ago

Thanks for the report! Sorry you ran into that — looks like something is mixed up.

What version of uv are you using and what version worked?

Related https://github.com/astral-sh/uv/issues/6661

lambda-science commented 2 weeks ago

Thanks for the report! Sorry you ran into that — looks like something is mixed up.

What version of uv are you using and what version worked?

Related #6661

Hey, thanks for the fast answer. Yes I guess it's a cringe Windows effect (yet another one, using Windows for work is only suffering) My UV version is:

$ uv --version
uv 0.3.3 (deea6025a 2024-08-23)

I guess it worked on 0.3.0. But someday without updating it stopped working also on 0.3.0, so I updated thinking it was a simple bug (to 0.3.3) and nope it doesn't work

zanieb commented 2 weeks ago

Okay great good to know. We'll look into this.

konstin commented 2 weeks ago

What environment and terminal are you using? I tried this in powershell and a mingw shell, but uvx --from build pyproject-build passed in both for me

lambda-science commented 2 weeks ago

What environment and terminal are you using? I tried this in powershell and a mingw shell, but uvx --from build pyproject-build passed in both for me

How I could give you more informations on my environnement ? Some command/variable ?

It fails in MINGW (Git for Windows), Powershell and CMD. => They don't activate the .venv by default BUT, new info: it works in JetBrains IDE because the integrated terminal activate the (.venv) by default.

(.venv) PS C:\Users\cmeyer\code-project\project-pythia> cd .\pythia-client\
(.venv) PS C:\Users\cmeyer\code-project\project-pythia\pythia-client> uv --version
uv 0.3.3 (deea6025a 2024-08-23)
(.venv) PS C:\Users\cmeyer\code-project\project-pythia\pythia-client> uvx --from build pyproject-build --installer uv
* Creating isolated environment: venv+uv...
* Using external uv from C:\Users\cmeyer\.cargo\bin\uv.EXE
* Installing packages in isolated environment:
  - hatchling
* Getting build dependencies for sdist...
* Building sdist...

If I deactivate it before:

(.venv) PS C:\Users\cmeyer\code-project\project-pythia> deactivate
PS C:\Users\cmeyer\code-project\project-pythia> cd .\pythia-client\
PS C:\Users\cmeyer\code-project\project-pythia\pythia-client> uvx --from build pyproject-build --installer uv
The executable `pyproject-build` was not found.
warning: An executable named `pyproject-build` is not provided by package `build`.
The following executables are provided by `build`:
- pyproject-build.exe
lambda-science commented 2 weeks ago

And by the way it only works because I've put build as a dev dependency in my virtual env. If I do uv remove --dev build, the old error is back

(.venv) PS C:\Users\cmeyer\code-project\project-pythia> uvx --from build pyproject-build --installer uv
The executable `pyproject-build` was not found.
warning: An executable named `pyproject-build` is not provided by package `build`.
The following executables are provided by `build`:
- pyproject-build.exe
lambda-science commented 2 weeks ago

image My PATH variable (puting .cargo\bin on top doesn't change anything)