Skip to content

Fixed Murfey's Auto-Update Function and Improved Pytest Functionality#625

Merged
tieneupin merged 18 commits intomainfrom
murfey-update-fix
Jul 14, 2025
Merged

Fixed Murfey's Auto-Update Function and Improved Pytest Functionality#625
tieneupin merged 18 commits intomainfrom
murfey-update-fix

Conversation

@tieneupin
Copy link
Contributor

@tieneupin tieneupin commented Jul 8, 2025

Resolves issue #624 .

The upgrade to Pydantic v2 has caused our current method of getting Murfey to check for updates on the client side to fail, as the files become locked and cannot be overwritten as part of the install.

Avoiding importing Murfey components that use Pydantic appears to resolve the issue, so the murfey.client modules have been refactored so that Pydantic-related components are not loaded when starting the TUI or instrument server until after the update check.

Additionally, this PR also adds tests for the client update and instrument server initialisation functions, and adds functionality to Pytest to skip database-related tests if it is being run outside of GitHub, allowing us to run it locally even if we don't have the database components set up.

tieneupin added 8 commits July 8, 2025 15:30
…lient.tui.main', since its contents are related to the initialisation of the TUI app

Removed unused key 'default_destination' from 'MurfeyInstanceEnvironment' setup, along with commented out keys
…ate checker is run through to completion before the components needed to update the server are imported and initialised, thereby avoiding the files associated with the process from becoming locked
…as a dependency under the 'standard' FastAPI package in 0.116.0, currently uses 'httpx'<0.28.0, which causes a clash with 'bump-my-version', which uses 'httpx'>=0.28.0; updates the 'murfey.client' entry point to point to where the function to initiliase the TUI app has been migrated to
@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 29.68750% with 135 lines in your changes missing coverage. Please review.

Project coverage is 32.95%. Comparing base (59d2aa4) to head (bf9d567).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #625      +/-   ##
==========================================
+ Coverage   32.30%   32.95%   +0.65%     
==========================================
  Files          92       90       -2     
  Lines       11119    11118       -1     
  Branches     1465     1465              
==========================================
+ Hits         3592     3664      +72     
+ Misses       7402     7324      -78     
- Partials      125      130       +5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tieneupin added 5 commits July 9, 2025 11:45
…nimise repetition and enable ease of use in test suite; added comment for when an 'exit()' is not needed
…e the client is correct, needs upgrading, or needs downgrading
…enuinely raise errors if they fail in the GitHub Actions runners
@tieneupin tieneupin marked this pull request as ready for review July 9, 2025 12:34
@tieneupin tieneupin requested review from d-j-hatton and stephen-riggs and removed request for d-j-hatton July 9, 2025 12:34
@tieneupin tieneupin changed the title Fixed Murfey's Auto-Update Function Fixed Murfey's Auto-Update Function and Improved Pytest Functionality Jul 9, 2025
@tieneupin tieneupin self-assigned this Jul 9, 2025
@tieneupin tieneupin added bug Something isn't working client Relates to the client component labels Jul 9, 2025
Copy link
Contributor

@stephen-riggs stephen-riggs left a comment

Choose a reason for hiding this comment

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

Looks fine to me. As discussed before, we need to be careful that the tests always do run on github, but I think the method you have here is fine.

I tried running the tests on my machine and found they crash if you have murfey_dls_extras installed, but otherwise all seemed good.

@tieneupin tieneupin merged commit a9dcf9a into main Jul 14, 2025
17 checks passed
@tieneupin tieneupin deleted the murfey-update-fix branch July 14, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working client Relates to the client component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The migration to Pydantic 2 causes a permissions error when Murfey tries to auto-update itself

2 participants