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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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)
e96d821Feat(env) dynamic virtual env support for advanced users7f5d591fixed 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
get_venv_path()helper intito/core/virtual_env_manager.py.tinyrcfor persistent venv_path when usingdirenv allowbin/activate-tinytorch.shnow accepts an optional argument specifying a custom virtual environment pathtito/commands/{doctor, base, export, info}.pyto respect the configured venv pathBackwards compatibility
If no
.tinyrcorVENV_PATHis provided, TinyTorch defaults to.venvas 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
tito checkpoint test 01passNext steps / Concerns
*.md) may be added once all modules are integratedpyproject.tomljupytextis not installed in the current requirementstito/commands/export.pyproperly works🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.