mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-11 17:49:25 -05:00
Merge remote-tracking branch 'origin/feature/tinytorch-core' into dev
This commit is contained in:
3
tinytorch/.gitattributes
vendored
3
tinytorch/.gitattributes
vendored
@@ -3,3 +3,6 @@ tinytorch/core/*.py linguist-generated=true
|
||||
tinytorch/**/*.py linguist-generated=true
|
||||
# Exclude from diff by default (reduces noise)
|
||||
tinytorch/core/*.py -diff
|
||||
# Set default line termination behavior for all text files (cross-platform)
|
||||
# Contributed by @rnjema (PR #1105)
|
||||
* text=auto
|
||||
|
||||
@@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.1.5] - 2026-01-27
|
||||
|
||||
### Added
|
||||
- Dynamic `tito --version` command showing current TinyTorch version
|
||||
- CHANGELOG.md for tracking releases
|
||||
- Updated publish workflow with release_type (patch/minor/major)
|
||||
- Windows/Git Bash support for installer script (thanks @rnjema, @joeswagson, @Kobra299!)
|
||||
- Platform detection (`get_platform()`) for OS-specific guidance
|
||||
- Cross-platform line endings via `.gitattributes`
|
||||
|
||||
### Changed
|
||||
- Version now managed in `tinytorch/__init__.py` and `pyproject.toml`
|
||||
- Installer uses `$PYTHON_CMD -m pip` for more reliable pip invocation
|
||||
- Dynamic `tito --version` command showing current TinyTorch version
|
||||
|
||||
### Fixed
|
||||
- Virtual environment activation now works correctly on Windows Git Bash
|
||||
|
||||
## [0.1.1] - 2025-01-13
|
||||
|
||||
|
||||
@@ -220,6 +220,19 @@ get_python_cmd() {
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Find the system platform (linux, macos, windows)
|
||||
# Contributed by @rnjema (PR #1105)
|
||||
get_platform() {
|
||||
local uname_out
|
||||
uname_out=$(uname -s)
|
||||
case "${uname_out}" in
|
||||
Linux*) echo "linux";;
|
||||
Darwin*) echo "macos";;
|
||||
CYGWIN*|MINGW*|MSYS*) echo "windows";;
|
||||
*) echo "unknown";;
|
||||
esac
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Pre-flight Checks
|
||||
# These run before any installation to catch problems early
|
||||
@@ -266,6 +279,7 @@ check_prerequisites() {
|
||||
|
||||
# Check for Python 3.10+
|
||||
PYTHON_CMD=$(get_python_cmd)
|
||||
PLATFORM=$(get_platform)
|
||||
if [ -n "$PYTHON_CMD" ]; then
|
||||
# We know it's good because get_python_cmd validates it, but we run check again to get the version string
|
||||
PY_VERSION=$(check_python_version "$PYTHON_CMD")
|
||||
@@ -293,6 +307,11 @@ check_prerequisites() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Show Windows-specific guidance (contributed by @rnjema)
|
||||
if [ "$PLATFORM" = "windows" ]; then
|
||||
print_info "Windows detected - using Git Bash/WSL compatible mode"
|
||||
fi
|
||||
|
||||
if [ $errors -gt 0 ]; then
|
||||
echo ""
|
||||
print_error "Missing prerequisites. Please fix the issues above."
|
||||
@@ -472,11 +491,12 @@ do_install() {
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Step 3: Install dependencies
|
||||
# Uses $PYTHON_CMD -m pip for reliability (contributed by @rnjema)
|
||||
# -------------------------------------------------------------------------
|
||||
echo -e "${BLUE}[3/4]${NC} Installing dependencies..."
|
||||
|
||||
# Upgrade pip first
|
||||
pip install --upgrade pip -q 2>/dev/null &
|
||||
$PYTHON_CMD -m pip install --upgrade pip -q 2>/dev/null &
|
||||
local pip_pid=$!
|
||||
spin $pip_pid "Upgrading pip..."
|
||||
wait $pip_pid
|
||||
@@ -484,14 +504,14 @@ do_install() {
|
||||
# Install from requirements.txt
|
||||
if [ -f "requirements.txt" ]; then
|
||||
total_pkgs=$(grep -c -E "^[^#]" requirements.txt 2>/dev/null || echo "?")
|
||||
pip install -r requirements.txt -q 2>/dev/null &
|
||||
$PYTHON_CMD -m pip install -r requirements.txt -q 2>/dev/null &
|
||||
local req_pid=$!
|
||||
spin $req_pid "Installing $total_pkgs packages..."
|
||||
wait $req_pid
|
||||
fi
|
||||
|
||||
# Install TinyTorch package in editable mode (includes tito CLI)
|
||||
pip install -e . -q 2>/dev/null &
|
||||
$PYTHON_CMD -m pip install -e . -q 2>/dev/null &
|
||||
local tt_pid=$!
|
||||
spin $tt_pid "Installing TinyTorch..."
|
||||
wait $tt_pid
|
||||
|
||||
Reference in New Issue
Block a user