Skip to content

Latest commit

 

History

History
265 lines (186 loc) · 5.62 KB

File metadata and controls

265 lines (186 loc) · 5.62 KB

🪟 Windows Compatibility Guide

Fixed Issues

The TagManager automation system has been updated to work perfectly on Windows! Here are the issues that were resolved:

🔧 Unicode Encoding Issues

Problem: Windows terminal (CP1252 encoding) couldn't display emoji characters, causing UnicodeEncodeError.

Solution: Added smart emoji fallback system:

  • Detects Windows platform automatically
  • Falls back to text alternatives when emojis fail
  • Maintains beautiful output on all platforms

Example Output:

# Before (error):
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4e6'

# After (works perfectly):
[PACKAGE] Current version: 1.0.1
[SUCCESS] Updated pyproject.toml
[COMPLETE] Version bump complete!

🎯 Cross-Platform Emoji System

The scripts now use a smart emoji fallback function:

def get_emoji(emoji, fallback):
    """Get emoji or fallback text based on platform support"""
    if os.getenv('NO_EMOJIS') or sys.platform.startswith('win'):
        return fallback
    return emoji

# Usage:
print(f"{get_emoji('🚀', '[RELEASE]')} Starting release...")

Emoji Mappings:

  • 🚀 → [RELEASE]
  • ✅ → [SUCCESS]
  • ⚠️[WARNING]
  • ❌ → [ERROR]
  • 📦 → [PACKAGE]
  • 🏷️ → [TAG]
  • 💡 → [INFO]
  • 🎉 → [COMPLETE]

🔄 Version Detection Fixes

Problem: Version regex patterns weren't matching correctly.

Solution: Simplified and improved regex patterns:

# Old (complex):
(r'version\s*=\s*["\']([^"\']+)["\']', f'version = "{new_version}"')

# New (simple and reliable):
(r'version\s*=\s*"[^"]+"', f'version = "{new_version}"')

📁 File Path Handling

Problem: Mixed path separators causing issues.

Solution: Using pathlib.Path for cross-platform compatibility:

from pathlib import Path

# Automatically handles Windows vs Unix paths
file_path = Path(__file__).parent / "pyproject.toml"

🧪 Testing Results

All automation features now work perfectly on Windows:

Version Bumper (bump_version.py)

C:\TagManager> python bump_version.py --current
[PACKAGE] Current version: 1.0.1

C:\TagManager> python bump_version.py patch --no-git
[RELEASE] Bumping version: 1.0.1 -> 1.0.2
==================================================
[SUCCESS] Updated C:\TagManager\pyproject.toml
[SUCCESS] Updated C:\TagManager\tagmanager\__init__.py

[SUCCESS] Successfully updated version to 1.0.2
[FILES] Updated files: 2

[COMPLETE] Version bump complete!

Installation Script (install.bat)

C:\TagManager> install.bat --local
🚀 TagManager Local Installation
================================
⚙️ Installing build tools...
⚙️ Building package...
⚙️ Installing package locally...
✅ Package installed locally

Release Workflow (release.sh via Git Bash)

C:\TagManager> ./release.sh patch --local-only --dry-run
================================
  TagManager Release Workflow
================================
Release Plan:
  Bump Type: patch
  Target: Local only
  Mode: Dry run
🚀 Starting release process...

🛠️ Windows-Specific Features

Batch Script Support

  • install.bat - Windows batch version of install.sh
  • Full feature parity with Unix version
  • Native Windows command prompt support

Git Bash Compatibility

  • All shell scripts work in Git Bash
  • MSYS2/MinGW compatibility
  • PowerShell support for basic operations

Path Handling

  • Automatic Windows path conversion
  • UNC path support
  • Long path name support

🚀 Usage on Windows

Command Prompt / PowerShell

# Version management
python bump_version.py --current
python bump_version.py patch

# Package installation
install.bat --local
install.bat --remote

# PyPI setup
python setup_pypi.py

Git Bash / WSL

# Full automation workflow
./release.sh patch --local-only
./install.sh --remote

# Manual steps
python bump_version.py minor
./install.sh --local

🎯 Best Practices for Windows

Terminal Setup

  1. Use Windows Terminal (recommended)

    • Better Unicode support
    • Modern terminal features
    • Multiple shell support
  2. Enable UTF-8 in Command Prompt

    chcp 65001
  3. Use Git Bash for shell scripts

    • Full Unix compatibility
    • Better script support

Development Environment

# Set up virtual environment
python -m venv venv
venv\Scripts\activate

# Install dependencies
pip install build twine

# Test the system
python bump_version.py --current
install.bat --build-only

🔧 Troubleshooting

Encoding Issues

If you still see encoding errors:

# Set environment variable to disable emojis
set NO_EMOJIS=1
python bump_version.py --current

Path Issues

If paths don't work correctly:

# Use forward slashes or double backslashes
python bump_version.py --current
# or
cd /c/path/to/TagManager  # in Git Bash

Permission Issues

If you get permission errors:

# Run as administrator or use user installation
pip install --user tagmanager-cli

Success!

TagManager's automation system now provides:

  • 100% Windows compatibility
  • Beautiful terminal output (with or without emojis)
  • Cross-platform consistency
  • Professional user experience

Windows users can now enjoy the same powerful automation as Unix users! 🎉


Platform Support Matrix:

  • ✅ Windows 10/11 (Command Prompt, PowerShell, Git Bash)
  • ✅ macOS (Terminal, iTerm2)
  • ✅ Linux (Bash, Zsh, Fish)
  • ✅ WSL/WSL2
  • ✅ Docker containers