[PR #7] [MERGED] Feature/dynamic venv config #9

Closed
opened 2025-11-02 00:09:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MLSysBook/TinyTorch/pull/7
Author: @Zappandy
Created: 10/11/2025
Status: ✅ Merged
Merged: 10/22/2025
Merged by: @profvjreddi

Base: dev ← Head: feature/dynamic-venv-config


📝 Commits (2)

  • e96d821 Feat(env) dynamic virtual env support for advanced users
  • 7f5d591 fixed default venv value in config for validation

📊 Changes

12 files changed (+63 additions, -22 deletions)

View changed files

📝 .envrc (+8 -4)
➕ .tinyrc (+3 -0)
📝 bin/activate-tinytorch.sh (+7 -3)
📝 tito/commands/base.py (+7 -0)
📝 tito/commands/doctor.py (+2 -3)
📝 tito/commands/export.py (+1 -1)
📝 tito/commands/help.py (+2 -2)
📝 tito/commands/info.py (+1 -3)
📝 tito/commands/protect.py (+2 -1)
📝 tito/core/config.py (+5 -4)
➕ tito/core/virtual_env_manager.py (+23 -0)
📝 tito/main.py (+2 -1)

📄 Description

Summary

Add dynamic virtual environment management to TinyTorch, allowing users to define a custom venv path instead of being restricted to .venv. This improves flexibility while keeping the default experience unchanged for beginners.

Main changes

  • Added get_venv_path() helper in tito/core/virtual_env_manager.py
  • New optional config file .tinyrc for persistent venv_path when using direnv allow
  • bin/activate-tinytorch.sh now accepts an optional argument specifying a custom virtual environment path
  • Updated tito/commands/{doctor, base, export, info}.py to respect the configured venv path

Backwards compatibility

If no .tinyrc or VENV_PATH is provided, TinyTorch defaults to .venv as before.

Rationale / Educational value

Demonstrates systems thinking and configurability by showing how environment management can be abstracted for reproducibility and scalability, particularly for users adding local features while maintaining basic healthcheck functionality.

Testing

  • Core module tests: pass
  • Basic integration tests: pass
  • Checkpoint validation: tito checkpoint test 01 pass
  • Tests dependent on Sequential: not yet implemented (future work)

Next steps / Concerns

  • Documentation updates (*.md) may be added once all modules are integrated
  • Update the placeholder pyproject.toml
  • jupytext is not installed in the current requirements
    • Because of this, I'm not sure whether the tito/commands/export.py properly works
  • If this PR is not suitable yet, I can shelve or revise it for later submission after all tests have been fully integrated in test

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MLSysBook/TinyTorch/pull/7 **Author:** [@Zappandy](https://github.com/Zappandy) **Created:** 10/11/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `feature/dynamic-venv-config` --- ### 📝 Commits (2) - [`e96d821`](https://github.com/MLSysBook/TinyTorch/commit/e96d821fa10aa5b7e87a379ee52ecce07cc1cd65) Feat(env) dynamic virtual env support for advanced users - [`7f5d591`](https://github.com/MLSysBook/TinyTorch/commit/7f5d591aed5edbc7ff6905ab342439c754c303fc) fixed default venv value in config for validation ### 📊 Changes **12 files changed** (+63 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `.envrc` (+8 -4) ➕ `.tinyrc` (+3 -0) 📝 `bin/activate-tinytorch.sh` (+7 -3) 📝 `tito/commands/base.py` (+7 -0) 📝 `tito/commands/doctor.py` (+2 -3) 📝 `tito/commands/export.py` (+1 -1) 📝 `tito/commands/help.py` (+2 -2) 📝 `tito/commands/info.py` (+1 -3) 📝 `tito/commands/protect.py` (+2 -1) 📝 `tito/core/config.py` (+5 -4) ➕ `tito/core/virtual_env_manager.py` (+23 -0) 📝 `tito/main.py` (+2 -1) </details> ### 📄 Description # Summary Add dynamic virtual environment management to TinyTorch, allowing users to define a custom venv path instead of being restricted to `.venv`. This improves flexibility while keeping the default experience unchanged for beginners. # Main changes - Added `get_venv_path()` helper in `tito/core/virtual_env_manager.py` - New optional config file `.tinyrc` for persistent venv_path when using `direnv allow` - `bin/activate-tinytorch.sh` now accepts an optional argument specifying a custom virtual environment path - Updated `tito/commands/{doctor, base, export, info}.py` to respect the configured venv path # Backwards compatibility If no `.tinyrc` or `VENV_PATH` is provided, TinyTorch defaults to `.venv` as before. # Rationale / Educational value Demonstrates systems thinking and configurability by showing how environment management can be abstracted for reproducibility and scalability, particularly for users adding local features while maintaining basic healthcheck functionality. # Testing - Core module tests: pass - Basic integration tests: pass - Checkpoint validation: `tito checkpoint test 01` pass - Tests dependent on Sequential: not yet implemented (future work) # Next steps / Concerns - Documentation updates (`*.md`) may be added once all modules are integrated - Update the placeholder `pyproject.toml` - `jupytext` is not installed in the current requirements - Because of this, I'm not sure whether the `tito/commands/export.py` properly works - If this PR is not suitable yet, I can shelve or revise it for later submission after all tests have been fully integrated in test --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 00:09:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/TinyTorch#9