Skip to content

fix(solvers): probe Xpress license with xpress.init - #1028

Open
Blizzeq wants to merge 2 commits into
PyPSA:masterfrom
Blizzeq:fix/xpress-license-probe
Open

Blizzeq wants to merge 2 commits into
PyPSA:masterfrom
Blizzeq:fix/xpress-license-probe

Conversation

@Blizzeq

@Blizzeq Blizzeq commented Oct 10, 2026

Copy link
Copy Markdown

Closes #994.

Changes proposed in this Pull Request

This PR adds an explicit license probe for the FICO Xpress solver using xpress.init() so unlicensed installations are accurately excluded from licensed_solvers.

Note

The following content was generated by AI.

Solver.license_status() and licensed_solvers rely on the per-solver _license_probe hook to detect whether an installed solver can acquire a valid license. Xpress previously relied on the default no-op probe, causing unlicensed or license-expired Xpress installations to be reported as licensed.

We implemented _license_probe on Xpress calling xpress.init() and added xpress = _LazyModule("xpress") so the module can be lazily probed and mock-tested without premature import side-effects. Added unit tests for the probe in test/test_available_solvers.py and a release note entry in doc/release_notes.rst.

Checklist

  • AI-generated content is marked (see AGENTS.md).
  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@codspeed

codspeed Bot commented Oct 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 181 untouched benchmarks
⏩ 181 skipped benchmarks1


Comparing Blizzeq:fix/xpress-license-probe (0b45725) with master (e0177b2)

Open in CodSpeed

Footnotes

  1. 181 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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.

Xpress missing _license_probe: licensed_solvers includes xpress with an out-of-date licence, breaking local tests

1 participant