Skip to content

Conversation

@cbentejac
Copy link
Contributor

@cbentejac cbentejac commented Sep 29, 2025

Description

This PR removes specific code that is Python 3.10 and over-compatible in the plugins module. This is motivated by the fact that meshroom_compute imports the plugins module and can be executed with a Python interpreter that is older than Python 3.10 (e.g. 3.9) when in the context of plugins. Python 3.10 code will raise a SyntaxError, thus causing meshroom_compute to fail in that context.

Although Meshroom is leaning towards supporting only Python 3.10 and over, the plugins module needs to also be compatible with older Python versions, hence the replacement of the match/case syntax with if/elif.

To prevent introducing some version-specific syntax that may affect meshroom_compute, the continous integration workflow, which runs on Python 3.11, is updated to include a step that will attempt to run meshroom_compute (and thus run through the import statements that may cause syntax errors) with Python 3.9.

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.54%. Comparing base (8d1b9ef) to head (6f4b900).
⚠️ Report is 3 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/plugins.py 0.00% 7 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2909      +/-   ##
===========================================
+ Coverage    79.52%   79.54%   +0.01%     
===========================================
  Files           51       51              
  Lines         6976     6975       -1     
===========================================
  Hits          5548     5548              
+ Misses        1428     1427       -1     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

When `meshroom_compute` is called with an interpreter that is older than
3.10, the `match/case` syntax raises an error, and the `plugins` module
absolutely needs to be imported. This Python 3.10-compatible syntax is
thus removed.
@cbentejac cbentejac force-pushed the fix/reloadPluginEnv branch 7 times, most recently from f68d66d to dc9dd50 Compare September 29, 2025 13:03
@cbentejac cbentejac marked this pull request as ready for review September 29, 2025 13:32
@servantftransperfect servantftransperfect merged commit f2f30fc into develop Sep 29, 2025
3 of 4 checks passed
@servantftransperfect servantftransperfect deleted the fix/reloadPluginEnv branch September 29, 2025 13:32
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