Skip to content

Load MathCAT relative to the app directory#19230

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
codeofdusk:fixup-mathcat-appdir
Nov 18, 2025
Merged

Load MathCAT relative to the app directory#19230
seanbudd merged 1 commit into
nvaccess:masterfrom
codeofdusk:fixup-mathcat-appdir

Conversation

@codeofdusk

Copy link
Copy Markdown
Contributor

Link to issue number:

Split from #19227.

Summary of the issue:

MathCAT is loaded from sys.prefix, which does not reliably point to the MathCAT directory on source copies.

Description of how this pull request fixes the issue:

The MathCAT path is calculated relative to globalVars.appDir.

Testing strategy:

Verified that MathCAT is usable on source copies.

Known issues with pull request:

None known

Code Review Checklist:

  • [n/a] Documentation: (out-of-scope, see Fixup MathCAT settings #19227)
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Copilot AI review requested due to automatic review settings November 18, 2025 01:28
@codeofdusk codeofdusk requested a review from a team as a code owner November 18, 2025 01:28
@codeofdusk codeofdusk requested a review from seanbudd November 18, 2025 01:28
@codeofdusk

Copy link
Copy Markdown
Contributor Author

CC @RyanMcCleary, @seanbudd.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the MathCAT directory resolution on source copies by changing from using sys.prefix to globalVars.appDir, with appropriate adjustments for source vs. installed copies.

  • Changes the base directory calculation in mathCATDir to use globalVars.appDir instead of sys.prefix
  • Adds conditional logic to handle source copies (using parent directory) and installed copies (using app directory directly)
  • Adds a docstring documenting the property's purpose

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codeofdusk codeofdusk mentioned this pull request Nov 18, 2025
5 tasks
@seanbudd

Copy link
Copy Markdown
Member

Thanks @codeofdusk

@seanbudd

Copy link
Copy Markdown
Member

pre-commit.ci run

@seanbudd seanbudd enabled auto-merge (squash) November 18, 2025 02:31
@seanbudd seanbudd merged commit 1472d4b into nvaccess:master Nov 18, 2025
41 checks passed
@github-actions github-actions Bot added this to the 2026.1 milestone Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants