Skip to content

Fix doctor command and check for SOCRATES updates#669

Open
nichollsh wants to merge 7 commits intomainfrom
hn/doctor
Open

Fix doctor command and check for SOCRATES updates#669
nichollsh wants to merge 7 commits intomainfrom
hn/doctor

Conversation

@nichollsh
Copy link
Copy Markdown
Member

@nichollsh nichollsh commented Apr 20, 2026

Description

  • Uses the packaging package to reliably check if modules are up to date with proteus doctor
  • Checks SOCRATES against latest release on FormingWorlds/SOCRATES
  • Checks correct fwl-aragog package, rather than deprecated aragog one
  • Add tests for proteus doctor command
  • Did not add new documentation since the command is already described

Closes #646

Future PRs should also check the Obliqua repo for updates, once a release has been made for it.

Validation of changes

Works on Fedora 43 with Python 3.12:

(proteus) [16:47:41] harrison@delphinium:~/Projects/PROTEUS
$ proteus doctor
Packages
fwl-aragog: ok
fwl-calliope: ok
fwl-janus: ok
fwl-proteus: Local version 25.11.19 is newer than latest release 25.10.15
fwl-mors: ok
fwl-zephyrus: Local version 25.10.28 is newer than latest release 25.3.11
fwl-zalmoxis: ok
AGNI: ok
SOCRATES: ok

Environment variables
FWL_DATA: ok
RAD_DIR: ok
ZALMOXIS_ROOT: ok
FC_DIR: ok
LA_DIR: Variable not set.

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

Relevant people

@timlichtenberg @egpbos

…ackage. Add tests for doctor command. Catch errors gracefully. Check socrates version.
Copilot AI review requested due to automatic review settings April 20, 2026 15:49
@nichollsh nichollsh marked this pull request as ready for review April 20, 2026 15:52
@nichollsh nichollsh requested a review from a team as a code owner April 20, 2026 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves proteus doctor by using reliable version parsing/comparison, expanding checks (SOCRATES + additional env vars), and adding unit tests to prevent regressions like downgrade suggestions.

Changes:

  • Switch version comparison logic to packaging.version.Version and add a “local is newer than latest release” status.
  • Update checked packages (use fwl-aragog) and add a SOCRATES latest-release check via GitHub.
  • Expand environment variable checks and add unit tests covering version-status logic and expected env vars.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/proteus/doctor.py Implements packaging-based version comparison, adds SOCRATES + env var checks, updates aragog package name.
tests/test_doctor.py Adds unit tests for BasePackage.get_status_message() behaviors and expected env vars list.
pyproject.toml Adds packaging dependency to support robust version parsing.

Comment thread src/proteus/doctor.py
Comment thread src/proteus/doctor.py
Comment thread tests/test_doctor.py Outdated
Comment thread src/proteus/doctor.py
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.50%. Comparing base (6fb36f6) to head (6790192).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #669      +/-   ##
==========================================
+ Coverage   69.15%   69.50%   +0.35%     
==========================================
  Files          98       98              
  Lines       10214    10225      +11     
  Branches     1422     1425       +3     
==========================================
+ Hits         7063     7107      +44     
+ Misses       2811     2805       -6     
+ Partials      340      313      -27     
Flag Coverage Δ
unit-tests 57.55% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nichollsh
Copy link
Copy Markdown
Member Author

@egpbos @timlichtenberg the patch coverage is now 100% and the tests are passing, so the PR is ready for review.

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.

Proteus doctor command suggests downgrade

2 participants