Conversation
* Introduce datetime compatibility utilities for Python 3.6 support. * Replace instances of datetime.fromisoformat with the new compatibility function across the codebase. * Ensure consistent date handling in various modules including action history, data aggregation, and validation.
* Updated version references across all relevant files * Enhanced bug report template with new version * Adjusted changelog, README, and project overview for version 1.7.0 * Updated startup scripts and technical specifications * Added utility script for version bumping
* Changed button text from "Start Day" to "Start Work" * Changed button text from "End Day" to "End Work"
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Worklog Manager application to version 1.7.0, introducing Python 3.6 compatibility by adding a datetime compatibility layer and refreshing UI terminology from "Start Day/End Day/Stop/Continue" to "Start Work/End Work/Take a Break/Resume Work". A new version bump script automates future version updates across all project files.
Key Changes
- Added
utils/datetime_compat.pyto providefromisoformat()support for Python 3.6 - Replaced all
datetime.fromisoformat()calls with the compatibility wrapper - Updated button labels and confirmation dialogs to use new workflow terminology
- Introduced
scripts/bump_version.pyto automate version bumps across documentation and code
Reviewed Changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/datetime_compat.py | New compatibility module for Python 3.6 datetime parsing |
| utils/validators.py | Updated to use datetime compatibility wrapper |
| utils/init.py | Import compatibility shim for early loading |
| main.py | Version bump and compatibility import |
| gui/main_window.py | Button label updates and version bump |
| gui/settings_dialog.py | Added ttk.Spinbox compatibility for older Python versions |
| gui/system_tray.py | Updated About dialog version and year |
| gui/components/break_tracker.py | Replaced emoji with ASCII symbols for compatibility |
| data/database.py | Updated to use datetime compatibility wrapper |
| core/*.py | Updated to use datetime compatibility wrapper |
| exporters/csv_exporter.py | Updated to use datetime compatibility wrapper |
| scripts/bump_version.py | New utility script for version management |
| start_worklog.* | Version bump to 1.7.0 |
| docs/*.md | Version bump to 1.7.0 |
| ROADMAP.md | Updated version sections |
| README.md | Version badge update |
| CHANGELOG.md | Version header update |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if index == 4: | ||
| year, month, day, hour, minute, second, microsecond, tz = groups | ||
| return datetime( | ||
| int(year), | ||
| int(month), | ||
| int(day), | ||
| int(hour), | ||
| int(minute), | ||
| int(second), | ||
| int(microsecond.ljust(6, '0')[:6]), | ||
| ) |
There was a problem hiding this comment.
The same datetime construction logic is duplicated across multiple pattern handlers (indices 0, 2, 4, 6). Consider extracting this into a helper function to reduce code duplication.
| if index == 0: | ||
| year, month, day, hour, minute, second, microsecond, tz = groups | ||
| return datetime( | ||
| int(year), | ||
| int(month), | ||
| int(day), | ||
| int(hour), | ||
| int(minute), | ||
| int(second), | ||
| int(microsecond.ljust(6, '0')[:6]), | ||
| ) | ||
|
|
||
| if index == 1: | ||
| year, month, day, hour, minute, second, tz = groups | ||
| return datetime(int(year), int(month), int(day), int(hour), int(minute), int(second)) |
There was a problem hiding this comment.
The timezone information extracted in groups for indices 0, 1, 4, 5 is captured but never used. Either parse and apply the timezone offset or remove it from the regex capture groups to clarify that timezone support is not implemented.
|
|
||
| def bump_minor(version: str) -> str: | ||
| major, minor, patch = version.split(".") | ||
| return f"{int(major)}.{int(minor) + 1}.{int(patch)}" |
There was a problem hiding this comment.
The function increments the minor version but does not reset the patch version to 0, which violates semantic versioning conventions. It should return f\"{int(major)}.{int(minor) + 1}.0\".
| return f"{int(major)}.{int(minor) + 1}.{int(patch)}" | |
| return f"{int(major)}.{int(minor) + 1}.0" |
| sys.path.insert(0, project_root) | ||
|
|
||
| # Import datetime compatibility for Python 3.6 support (must be imported early) | ||
| from utils.datetime_compat import datetime_fromisoformat, fromisoformat_compat # noqa: F401 |
There was a problem hiding this comment.
The fromisoformat_compat import is unused in this file. Since the comment states this is imported early for compatibility reasons and utils/__init__.py already imports datetime_compat, remove the unused fromisoformat_compat import.
| from utils.datetime_compat import datetime_fromisoformat, fromisoformat_compat # noqa: F401 | |
| from utils.datetime_compat import datetime_fromisoformat |
Pull Request
Description
Prepare the 1.7.0 release by updating all version references, refreshing the primary action button labels (“Start Work”, “End Work”, “Take a Break”, “Resume Work”) along with related prompts/logging, updating the About dialog to the new version and year, and introducing a reusable
scripts/bump_version.pyhelper for future version bumps.Related Issues
Closes #N/A
Type of Change
Changes Made
scripts/bump_version.pyto automate future version updates (supports--dry-run,--current,--skip-roadmap)Testing Performed
Describe the testing you've done:
Test Results
Screenshots (if applicable)
N/A
Checklist
Additional Notes
The new bump script streamlines future releases; run
python scripts/bump_version.py <new_version>with the available flags as needed.Breaking Changes
None.