docs: clarify Python venv mechanisms, JAVA_HOME behavior, and activation performance#8928
docs: clarify Python venv mechanisms, JAVA_HOME behavior, and activation performance#8928
Conversation
…ion performance Python venvs: - Add comparison table for _.python.venv vs python.uv_venv_auto - Explain when to use each mechanism - Warn that they have separate code paths and settings - Add shims limitation note for venv activation - Add inline example for python.uv_venv_auto setting Java: - Add JAVA_HOME section explaining it requires mise activate - Add troubleshooting for stale JAVA_HOME after version switch Performance: - Add diagnostic tip for slow prompts (_.source scripts, MISE_TRACE) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace generic advice with specific instructions to use MISE_TIMINGS=1 (or =2 for detailed breakdowns) to identify what's causing slow prompt latency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for mise, focusing on performance troubleshooting, JAVA_HOME configuration for Java, and Python virtual environment management. Key additions include a comparison table for Python venv mechanisms and troubleshooting tips for shell latency. A review comment correctly identified a naming inconsistency in a warning message regarding uv_create_args and provided a suggestion to align it with the configuration examples.
| **`python.uv_venv_auto`** is designed for uv-managed projects. It detects an existing `.venv` created by `uv` and sources it. Use `"source"` to only activate existing venvs, or `"create|source"` to create if missing. | ||
|
|
||
| ::: warning | ||
| These are separate mechanisms with different code paths. Settings like `python.uv_venv_create_args` only apply to `_.python.venv` (when uv is installed), not to `python.uv_venv_auto`. |
There was a problem hiding this comment.
The warning refers to python.uv_venv_create_args, but the configuration examples below (lines 77 and 81) use python_create_args and uv_create_args. Additionally, these are options for the _.python.venv directive rather than global settings. It would be more accurate to reference the option names used in the examples.
| These are separate mechanisms with different code paths. Settings like `python.uv_venv_create_args` only apply to `_.python.venv` (when uv is installed), not to `python.uv_venv_auto`. | |
| These are separate mechanisms with different code paths. Options like uv_create_args only apply to _.python.venv (when uv is installed), not to python.uv_venv_auto. |
Without clearing __MISE_DIFF/__MISE_SESSION/__MISE_WATCH, hook-env short-circuits and doesn't show meaningful timing data. Add the unset step and show both MISE_TIMINGS=1 and =2 with proper flags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The slow prompt diagnostics are about mise activate, not shims. Move to a dedicated "Slow shell prompts" section in troubleshooting with a link from the shims performance section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unsetting state vars in an activated shell triggers hook-env on the next prompt before the user can run their manual command. Use bash --norc instead to get a clean measurement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis docs-only PR adds three new sections and refactors an existing one across four documentation files to address the most common user confusion patterns found in GitHub discussions. Python venv: The virtualenv section is restructured with a comparison table ( Confidence Score: 5/5Docs-only PR is safe to merge; all technical claims verified against source code No code changes, no P0/P1 issues found. All new content (MISE_TIMINGS behavior, mise deactivate, JAVA_HOME export, uv_venv_auto values) was cross-checked against src/timings.rs, src/cli/deactivate.rs, src/plugins/core/java.rs, and src/config/settings.rs. Only open concern (uv_venv_create_args accuracy) was already addressed in a prior review thread. No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User wants automatic\nvirtualenv activation] --> B{Is it a uv project?\ne.g. has uv.lock}
B -- Yes --> C[python.uv_venv_auto\nin \[settings\]]
B -- No --> D[_.python.venv\nin \[env\] section]
C --> E['source' — activate existing .venv\n'create|source' — create if missing]
D --> F[path + create + python_create_args\nor uv_create_args]
E --> G[Requires mise activate\nor mise exec]
F --> G
G --> H[Shims alone do NOT\nadd venv/bin/ to PATH]
Reviews (3): Last reviewed commit: "docs: fix deactivate usage and don't cla..." | Re-trigger Greptile |
Simpler approach: deactivate mise first so the prompt hook won't re-trigger, then run hook-env with MISE_TIMINGS manually. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8607a6c to
61149fc
Compare
Reference the actual _.python.venv option names (uv_create_args, python_create_args) instead of the unrelated global setting name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mise deactivate outputs shell commands directly like activate, no eval needed. Also reword shims suggestion since shims just move the cost to tool invocation rather than reducing it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.4 x -- echo |
17.4 ± 0.5 | 16.3 | 19.2 | 1.00 |
mise x -- echo |
17.9 ± 0.5 | 16.9 | 19.8 | 1.03 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.4 env |
16.9 ± 0.4 | 16.1 | 21.9 | 1.00 |
mise env |
17.4 ± 0.7 | 16.4 | 24.3 | 1.03 ± 0.05 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.4 hook-env |
17.5 ± 0.4 | 16.6 | 19.3 | 1.00 |
mise hook-env |
18.4 ± 0.6 | 17.2 | 25.1 | 1.05 ± 0.04 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.4 ls |
16.8 ± 0.5 | 15.6 | 19.4 | 1.00 |
mise ls |
17.0 ± 0.4 | 15.6 | 18.2 | 1.01 ± 0.04 |
xtasks/test/perf
| Command | mise-2026.4.4 | mise | Variance |
|---|---|---|---|
| install (cached) | 116ms | 116ms | +0% |
| ls (cached) | 65ms | 67ms | -2% |
| bin-paths (cached) | 68ms | 68ms | +0% |
| task-ls (cached) | 706ms | 698ms | +1% |
### 🚀 Features - **(config)** report env files in config ls and doctor output by @SamSoldatenko in [#8853](#8853) - add support for token sources in GitLab and Forgejo by @roele in [#8868](#8868) ### 🐛 Bug Fixes - **(aqua)** prevent double .exe extension when Windows override URL already ends in .exe by @yusei-wy in [#8863](#8863) - **(bash)** avoid duplicate trust warning after cd by @timothysparg in [#8920](#8920) - **(env)** prevent config root injection into PATH via _.source by @jdx in [#8936](#8936) - **(install)** suppress spurious dependency warning when tool is configured by @jdx in [#8923](#8923) ### 📚 Documentation - **(node)** add section on pinning npm version by @jdx in [#8925](#8925) - add Windows default paths and mise.toml examples alongside CLI commands by @jdx in [#8926](#8926) - clarify common sources of confusion from GitHub discussions by @jdx in [#8927](#8927) - clarify Python venv mechanisms, JAVA_HOME behavior, and activation performance by @jdx in [#8928](#8928) - add FAQ and troubleshooting entries based on common Discord questions by @jdx in [#8930](#8930) ### New Contributors - @SamSoldatenko made their first contribution in [#8853](#8853) - @yusei-wy made their first contribution in [#8863](#8863)
Summary
Based on patterns found in ~1600 GitHub discussions from the past year:
Python virtualenvs (most common confusion topic — #5228, #7252, #8321, #8376):
_.python.venvvspython.uv_venv_autoso users know which to useuv_venv_create_argsonly applies to_.python.venv)python.uv_venv_automise activate— shims alone don't add venv to PATHJAVA_HOME (#4827, #6283, #7625):
mise activateActivation performance (#4821, #6279, #7042):
Test plan
mise run docs🤖 Generated with Claude Code
Note
Low Risk
Low risk: documentation-only updates clarifying activation/shims behavior, virtualenv mechanisms, and how to profile slow prompts; no runtime or config logic changes.
Overview
Clarifies that some environment-dependent behaviors require full activation: adds a
JAVA_HOMEsection to the Java docs (including a quick fix for stale values) and notes that shims alone won’t set env vars.Reworks Python virtualenv docs to distinguish
_.python.venvvspython.uv_venv_auto(with a comparison table, warnings about separate option paths, and an inlinepython.uv_venv_autoexample), plus a tip that venv PATH activation requiresmise activate/mise execrather than shims.Adds a new troubleshooting section for diagnosing slow shell prompts using
MISE_TIMINGS, and links to it from the shims performance discussion.Reviewed by Cursor Bugbot for commit c7ce79b. Bugbot is set up for automated code reviews on this repo. Configure here.