[core] plugins: Do not use Python 3.10-and-over syntax #2909
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR removes specific code that is Python 3.10 and over-compatible in the
pluginsmodule. This is motivated by the fact thatmeshroom_computeimports thepluginsmodule 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 aSyntaxError, thus causingmeshroom_computeto fail in that context.Although Meshroom is leaning towards supporting only Python 3.10 and over, the
pluginsmodule needs to also be compatible with older Python versions, hence the replacement of thematch/casesyntax withif/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 runmeshroom_compute(and thus run through theimportstatements that may cause syntax errors) with Python 3.9.