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

Improve logging during interpreter discovery #3790

Merged
merged 1 commit into from
May 23, 2024
Merged

Improve logging during interpreter discovery #3790

merged 1 commit into from
May 23, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented May 23, 2024

❯ VIRTUAL_ENV=.venv cargo run -q -- pip install anyio -v
DEBUG Searching for interpreter that fulfills Python @ default in virtual environments
DEBUG Found Python interpreter cpython 3.12.3 at `.venv/bin/python` (active virtual environment)
DEBUG Using Python 3.12.3 environment at .venv/bin/python
DEBUG Trying to lock if free: .venv/.lock
DEBUG Requirement satisfied: anyio
DEBUG Requirement satisfied: idna>=2.8
DEBUG Requirement satisfied: sniffio>=1.1
DEBUG All editables satisfied: 
Audited 1 package in 14ms

instead of

❯ VIRTUAL_ENV=.venv cargo run -q -- pip install anyio -v
DEBUG Searching for interpreter that fulfills Python @ default
DEBUG Searching for interpreter that fulfills Python @ default
INFO Found active virtual environment (via VIRTUAL_ENV) at: .venv
DEBUG Found a virtual environment at: /Users/zb/workspace/uv/.venv
DEBUG Using Python 3.12.3 environment at .venv/bin/python
DEBUG Trying to lock if free: .venv/.lock
DEBUG Requirement satisfied: anyio
DEBUG Requirement satisfied: idna>=2.8
DEBUG Requirement satisfied: sniffio>=1.1
DEBUG All editables satisfied: 
Audited 1 package in 16ms

@zanieb zanieb added the tracing Verbose output and debugging label May 23, 2024
@charliermarsh
Copy link
Member

What is Python @ default?

Should Found Python interpreter cpython 3.12.3 perhaps be something like Found cpython@3.12.3 at...? "Python interpreter {impl}" is maybe a bit redundant?

@zanieb
Copy link
Member Author

zanieb commented May 23, 2024

"Python @ default" was resolved / removed in #3789

The implementation name display is being changed in #3791 — I do agree it feels a little redundant though. Let me rebase onto main and tweak a bit more.

@zanieb
Copy link
Member Author

zanieb commented May 23, 2024

Now it looks like

DEBUG Searching for interpreter that fulfills any Python in virtual environments
DEBUG Found CPython 3.12.3 at `.venv/bin/python` (active virtual environment)
DEBUG Using Python 3.12.3 environment at .venv/bin/python

@zanieb
Copy link
Member Author

zanieb commented May 23, 2024

Specialized the search message per request kind so we can do a little better e.g.

❯ VIRTUAL_ENV=.venv cargo run -q -- pip install anyio -v
DEBUG Searching for Python interpreter in virtual environments
DEBUG Found CPython 3.12.3 at `.venv/bin/python` (active virtual environment)
DEBUG Using Python 3.12.3 environment at .venv/bin/python
❯ cargo run -q -- pip install anyio -v --python cpython
DEBUG Searching for a CPython interpreter in all sources
DEBUG Found CPython 3.12.3 at `/Users/zb/workspace/uv/.venv/bin/python` (virtual environment)
DEBUG Using Python 3.12.3 environment at .venv/bin/python
❯ cargo run -q -- pip install anyio -v --python .venv
DEBUG Checking for Python interpreter in directory .venv
DEBUG Using Python 3.12.3 environment at .venv/bin/python
❯ cargo run -q -- pip install anyio -v --python .venv/bin/python
DEBUG Checking for Python interpreter at path .venv/bin/python
DEBUG Using Python 3.12.3 environment at .venv/bin/python

# Conflicts:
#	crates/uv-interpreter/src/discovery.rs
@zanieb zanieb merged commit 8f0f4d2 into main May 23, 2024
45 checks passed
@zanieb zanieb deleted the zb/interp-log branch May 23, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracing Verbose output and debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants