This document outlines the changes made to modernize gitcheck for Python 3 and enhance terminal output with the Rich library.
- Old:
setup.pywith manual configuration - New:
pyproject.tomlfollowing PEP 517/518 standards - All package metadata now in standardized TOML format
- Cleaner, more maintainable configuration
- Old: Python 2.7 and Python 3.3+
- New: Python 3.8+ only
- The
from __future__ importstatements have been removed as they're no longer needed
- Removed:
colored,colorama - Added:
rich>=13.0.0
- Old:
setup.pywith custom RST processing - New:
pyproject.tomlwith standard metadata format - Installation and build process remain the same for end users
- Follows modern Python packaging standards (PEP 517/518/621)
All terminal output now uses the Rich library for:
- Beautiful, consistent colored output across all platforms (Windows, Linux, macOS)
- Modern markup syntax for colors and styles
- Better readability and user experience
- Automatic color detection and terminal capability handling
- Fixed PEP8 compliance issues
- Removed ambiguous variable names (e.g.,
l→line) - Used context managers for file operations
- Modern string formatting with f-strings
- Removed Windows-specific color initialization (Rich handles this automatically)
Ensure you have Python 3.8 or later:
python --versionpip install -r requirements/base.txtOr if installing from source:
pip install -e .If you have a ~/mygitcheck.py custom configuration file, update the color theme format:
Old format (using colored library):
from colored import fg, bg, attr
colortheme = {
'default': attr('reset') + fg('white'),
'prjchanged': attr('reset') + attr('bold') + fg('deep_pink_1a'),
# ... etc
}New format (using Rich markup):
colortheme = {
'default': 'white',
'prjchanged': 'bold deep_pink1',
'prjremote': 'magenta',
'prjname': 'chartreuse1',
'reponame': 'light_goldenrod2',
'branchname': 'white',
'fileupdated': 'light_goldenrod2',
'remoteto': 'deep_sky_blue3',
'committo': 'violet',
'commitinfo': 'deep_sky_blue3',
'commitstate': 'deep_pink1',
}Note: You no longer need to specify 'bell' and 'reset' keys - these are handled automatically.
- Cross-platform: Works perfectly on Windows without special initialization
- Modern: Beautiful terminal output with emoji and advanced formatting support
- Consistent: Same appearance across different terminal emulators
- Feature-rich: Built-in support for tables, panels, progress bars, and more
- Maintained: Actively developed and widely used in the Python ecosystem
After migration, test the tool:
# Simple test
gitcheck
# Verbose output
gitcheck -v
# Help to see all options
gitcheck -hIf you need to use the old version temporarily, check out the last Python 2 compatible commit before upgrading.
For issues or questions about the migration, please open an issue on GitHub.