◐ Shell
clean mode source ↗

Upgrade venv to v3.13.11 by youknowone · Pull Request #6459 · RustPython/RustPython

Walkthrough

The change adds virtual environment detection support to the _base_executable function by introducing __PYVENV_LAUNCHER__ environment variable checking and a new private function get_venv_base_executable() that detects the base executable by parsing pyvenv.cfg files with platform-specific path resolution.

Changes

Cohort / File(s) Summary
Virtual Environment Support
crates/vm/src/stdlib/sys.rs
Added get_venv_base_executable() private function to detect base executable from pyvenv.cfg; modified _base_executable() to check __PYVENV_LAUNCHER__ environment variable and fallback to venv detection with cross-platform path handling for wasm32 and non-wasm32 targets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Logic for reading and parsing pyvenv.cfg configuration files requires careful validation
  • Platform-specific path handling across wasm32 and non-wasm32 targets should be tested
  • Edge cases for __PYVENV_LAUNCHER__ environment variable precedence and fallback paths warrant attention

Poem

🐰 A venv within a venv, how quite the treat,
Environment variables make it complete,
Config files parsed with rabbit-like care,
Base executables found everywhere! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Upgrade venv to v3.13.11' is too vague and doesn't accurately describe the actual changes made to the codebase. The PR modifies sys.rs to add venv base executable detection via pyvenv.cfg parsing and PYVENV_LAUNCHER handling. Consider a more specific title like 'Add venv base executable detection from pyvenv.cfg' to better reflect the technical changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.