From 11e2858d6c091f032a4c061f31b1f365d07cf678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Mon, 29 Sep 2025 14:15:58 +0200 Subject: [PATCH 1/2] [core] plugins: Use Python < 3.10-compatible syntax 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. --- meshroom/core/plugins.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/meshroom/core/plugins.py b/meshroom/core/plugins.py index 1e94b5bf54..3a46500578 100644 --- a/meshroom/core/plugins.py +++ b/meshroom/core/plugins.py @@ -188,19 +188,18 @@ def resolveRezSubrequires(self) -> list[str]: # in the current environment (if they are resolved in it) for package in subrequires: packageTuple = self.REZ_DELIMITER_PATTERN.split(package, maxsplit=1) - match len(packageTuple): - case 1: - # Only the package name in the subrequires. - # Search for a corresponding version in the parent environment. - packageName = packageTuple[0] - parentResolvedVersion = resolvedVersions.get(packageName) - if parentResolvedVersion: - packages.append(f"{packageName}=={parentResolvedVersion}") - else: - packages.append(package) - case 2: - # The subrequires ask for a specific version + if len(packageTuple) == 1: + # Only the package name in the subrequires. + # Search for a corresponding version in the parent environment. + packageName = packageTuple[0] + parentResolvedVersion = resolvedVersions.get(packageName) + if parentResolvedVersion: + packages.append(f"{packageName}=={parentResolvedVersion}") + else: packages.append(package) + elif len(packageTuple) == 2: + # The subrequires ask for a specific version + packages.append(package) def extractPackageName(packageString: str) -> str: return self.REZ_DELIMITER_PATTERN.split(packageString, maxsplit=1)[0] From 6f4b90025c8462003c4a86000c6061ffbdf4ea0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Mon, 29 Sep 2025 15:03:26 +0200 Subject: [PATCH 2/2] [ci] Add a test running `meshroom_compute` with Python 3.9 --- .github/workflows/continuous-integration.yml | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 113cab206b..e04913250d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,6 +18,7 @@ on: env: CI: True + PYTHONPATH: ${{ github.workspace }} jobs: build-linux: @@ -56,6 +57,17 @@ jobs: uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Set up Python 3.9 - meshroom_compute test + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies (Python 3.9) - meshroom_compute test + run: | + python3.9 -m pip install --upgrade pip + python3.9 -m pip install -r requirements.txt --timeout 45 + - name: Run imports - meshroom_compute test + run: | + python3.9 bin/meshroom_compute -h build-windows: runs-on: windows-latest @@ -83,3 +95,14 @@ jobs: - name: Test with pytest run: | pytest tests/ + - name: Set up Python 3.9 - meshroom_compute test + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies (Python 3.9) - meshroom_compute test + run: | + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements.txt --timeout 45 + - name: Run imports - meshroom_compute test + run: | + python3 bin/meshroom_compute -h