Skip to content

Case-aware application#151

Merged
th3w1zard1 merged 12 commits into
masterfrom
case-aware-application
May 28, 2026
Merged

Case-aware application#151
th3w1zard1 merged 12 commits into
masterfrom
case-aware-application

Conversation

@th3w1zard1
Copy link
Copy Markdown
Collaborator

@th3w1zard1 th3w1zard1 commented Mar 10, 2026

Description

This pull request introduces comprehensive improvements to path handling across the codebase by replacing usages of Path with the custom CaseAwarePath class. This ensures robust, case-insensitive file and directory resolution—particularly important for archive files, virtual paths, and cross-platform compatibility.

It also includes updated logic, expanded test coverage, cleanup of obsolete imports, and a merge-conflict resolution update to keep the branch aligned with the latest master changes.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test addition or update
  • 🔨 Build system or CI changes
  • 🎨 Code style changes (formatting, renaming, etc.)

Package(s) Affected

  • PyKotor (core library)
  • One or more tools under Tools/
  • Documentation
  • CI/CD
  • Other: ___________

Changes Made

Path handling improvements

  • Replaced usages of Path with CaseAwarePath in affected modules, improving case-insensitive path resolution and support for archive files and virtual paths.
  • Updated path-related logic in functions and class initializers to consistently use CaseAwarePath for existence checks, directory operations, and path joining.
  • Removed unnecessary imports of Path in modules now fully migrated to CaseAwarePath.

Archive and virtual path resolution

  • Enhanced the _resolve_path method in CaseAwarePath to avoid scanning archive files for virtual segments, preventing unnecessary filesystem operations and improving performance for pseudo-paths inside archives.

Testing and validation

  • Added and updated tests to verify correct behavior for:
    • Case-mismatched paths
    • Archive-internal virtual paths
    • Cross-platform path resolution scenarios
  • Updated the conflicted test files to preserve both the new case-mismatch coverage and the latest test refactors from master.
  • Test coverage changes include:
    • test_case_aware_path.py
    • test_capsule.py
    • test_talktable.py
    • test_heuristics.py

Branch sync and merge resolution

  • Resolved merge conflicts against the latest master.
  • Kept the PyKotor path-handling changes and associated tests intact while aligning the branch with the current repository structure, including the Tools/HolocronToolset submodule layout from master.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this manually
  • I have tested on multiple Python versions (3.8+)
  • I have tested on multiple operating systems (if applicable)

Test Results

ruff check Libraries/PyKotor/tests/extract/test_capsule.py Libraries/PyKotor/tests/extract/test_talktable.py
python -m pytest Libraries/PyKotor/tests/common/test_case_aware_path.py Libraries/PyKotor/tests/extract/test_capsule.py Libraries/PyKotor/tests/extract/test_talktable.py -q

26 passed, 3 warnings, 16 subtests passed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Related Issues

Screenshots (if applicable)

Additional Notes

This PR now includes the merge-conflict resolution needed to keep the case-aware path work current with master, without changing the intended functionality of the original fix.

ProjectSynchro and others added 8 commits February 8, 2026 08:25
Once resolution reaches a regular file, preserve the remaining segments without attempting case-insensitive directory scans.
This approach makes the toolset look less like it is hanging when populating views.
…e_installation calls

change_active_installation seems to loop loading which makes the current view hang for quite a while when loading initially.
currently the toolset doesn't launch in mingw
@github-actions github-actions Bot added python Pull requests that update python code tools libraries size/L Large PR (300-500 lines) labels Mar 10, 2026
Comment thread Libraries/PyKotor/tests/common/test_case_aware_path.py Fixed
Comment thread Libraries/PyKotor/tests/extract/test_capsule.py Fixed
Comment thread Libraries/PyKotor/tests/extract/test_talktable.py Fixed
Comment thread Libraries/PyKotor/src/pykotor/tools/door.py Fixed
Comment thread Libraries/PyKotor/src/pykotor/tools/placeable.py Fixed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7c616773d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +515 to +519
while True:
try:
self.ui.gameCombo.currentIndexChanged.disconnect(self.change_active_installation)
except (TypeError, RuntimeError):
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Break disconnect loop when no handler is attached

_disconnect_game_combo_signal() depends on disconnect(self.change_active_installation) throwing to terminate while True, but some Qt bindings return a falsy value instead of raising when the slot is no longer connected. In that environment, this loop never exits and the UI can hang when reload_installations() or unset_installation() calls this helper. Make the loop break on a falsy disconnect result (or disconnect once) so the code works across bindings.

Useful? React with 👍 / 👎.

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 10, 2026

🔨 Build Validation Summary

Version Check: Passed

Tool Builds

⚠️ HoloPatcher: cancelled
⚠️ HoloPazaak: cancelled
⚠️ KotorDiff: cancelled
⚠️ KotorMCP: cancelled


🎉 All builds validated successfully! This PR is ready for merge.

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@github-actions github-actions Bot added the stale Stale issue or PR label May 7, 2026
@th3w1zard1
Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

@OpenKotOR OpenKotOR deleted a comment from github-actions Bot May 27, 2026
@th3w1zard1 th3w1zard1 removed the stale Stale issue or PR label May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

@copilot resolve the merge conflicts in this pull request

Addressed in bcb55861a.

Copilot AI changed the title Case aware application Case-aware application May 27, 2026
@github-actions github-actions Bot added package: kotordiff Related to KotorDiff package: pykotor Related to PyKotor core labels May 27, 2026
@th3w1zard1 th3w1zard1 merged commit a731a05 into master May 28, 2026
24 of 30 checks passed
@th3w1zard1 th3w1zard1 deleted the case-aware-application branch May 28, 2026 00:07
@th3w1zard1
Copy link
Copy Markdown
Collaborator Author

Thanks @ProjectSynchro :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries package: holocrontoolset package: holopatcher Related to HoloPatcher package: kotordiff Related to KotorDiff package: pykotor Related to PyKotor core python Pull requests that update python code size/L Large PR (300-500 lines) size/M Medium PR (100-300 lines) tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants