Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv export should not need to have python installed #8634

Closed
mjpieters opened this issue Oct 28, 2024 · 4 comments · Fixed by #8638
Closed

uv export should not need to have python installed #8634

mjpieters opened this issue Oct 28, 2024 · 4 comments · Fixed by #8638
Assignees
Labels
question Asking for clarification or support

Comments

@mjpieters
Copy link

mjpieters commented Oct 28, 2024

We are running a CI pipeline that includes a mend.io license compliance scanner, which looks for a requirements.txt file (it doesn't yet support uv.lock as an input file). We run the mend scanner in a minimal docker container with no Python installed. I can trivially install uv into that container, but without a python installation, I can't export the lock file to requirements.txt file:

$ uv --version
uv 0.4.27
$ uv export --output-file requirements.txt
error: No interpreter found for Python >=3.12 in managed installations or system path

Python should not be necessary here, all that is needed is that uv produces a requirements.txt file for another tool to then process.

The same applies to the tree command; uv has all the information needed already, a Python interpreter should not be necessary.

@zanieb
Copy link
Member

zanieb commented Oct 28, 2024

I think we could do this with --frozen by making this block conditional

let interpreter = ProjectInterpreter::discover(
project.workspace(),
python.as_deref().map(PythonRequest::parse),
python_preference,
python_downloads,
connectivity,
native_tls,
cache,
printer,
)
.await?
.into_interpreter();

Otherwise, we need an interpreter to check if the lockfile is up to date.

@charliermarsh charliermarsh added the question Asking for clarification or support label Oct 28, 2024
@charliermarsh charliermarsh self-assigned this Oct 28, 2024
@charliermarsh
Copy link
Member

(In uv tree, we need an interpreter unless the user passes --universal.)

@zanieb
Copy link
Member

zanieb commented Oct 28, 2024

Are you talking about uv pip tree? Nevermind, I see we show the tree for the current platform by default.

@mjpieters
Copy link
Author

Right, it didn't occur to me that tree would be platform dependant. I'm happy to ignore uv tree in this bug report, I am much more concerned with uv export in CI environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants