Skip to content

Commit f2f30fc

Browse files
Merge pull request #2909 from alicevision/fix/reloadPluginEnv
[core] plugins: Do not use Python 3.10-and-over syntax
2 parents 8d1b9ef + 6f4b900 commit f2f30fc

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
env:
2020
CI: True
21+
PYTHONPATH: ${{ github.workspace }}
2122

2223
jobs:
2324
build-linux:
@@ -56,6 +57,17 @@ jobs:
5657
uses: codecov/test-results-action@v1
5758
with:
5859
token: ${{ secrets.CODECOV_TOKEN }}
60+
- name: Set up Python 3.9 - meshroom_compute test
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: 3.9
64+
- name: Install dependencies (Python 3.9) - meshroom_compute test
65+
run: |
66+
python3.9 -m pip install --upgrade pip
67+
python3.9 -m pip install -r requirements.txt --timeout 45
68+
- name: Run imports - meshroom_compute test
69+
run: |
70+
python3.9 bin/meshroom_compute -h
5971
6072
build-windows:
6173
runs-on: windows-latest
@@ -83,3 +95,14 @@ jobs:
8395
- name: Test with pytest
8496
run: |
8597
pytest tests/
98+
- name: Set up Python 3.9 - meshroom_compute test
99+
uses: actions/setup-python@v4
100+
with:
101+
python-version: 3.9
102+
- name: Install dependencies (Python 3.9) - meshroom_compute test
103+
run: |
104+
python3 -m pip install --upgrade pip
105+
python3 -m pip install -r requirements.txt --timeout 45
106+
- name: Run imports - meshroom_compute test
107+
run: |
108+
python3 bin/meshroom_compute -h

meshroom/core/plugins.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,18 @@ def resolveRezSubrequires(self) -> list[str]:
188188
# in the current environment (if they are resolved in it)
189189
for package in subrequires:
190190
packageTuple = self.REZ_DELIMITER_PATTERN.split(package, maxsplit=1)
191-
match len(packageTuple):
192-
case 1:
193-
# Only the package name in the subrequires.
194-
# Search for a corresponding version in the parent environment.
195-
packageName = packageTuple[0]
196-
parentResolvedVersion = resolvedVersions.get(packageName)
197-
if parentResolvedVersion:
198-
packages.append(f"{packageName}=={parentResolvedVersion}")
199-
else:
200-
packages.append(package)
201-
case 2:
202-
# The subrequires ask for a specific version
191+
if len(packageTuple) == 1:
192+
# Only the package name in the subrequires.
193+
# Search for a corresponding version in the parent environment.
194+
packageName = packageTuple[0]
195+
parentResolvedVersion = resolvedVersions.get(packageName)
196+
if parentResolvedVersion:
197+
packages.append(f"{packageName}=={parentResolvedVersion}")
198+
else:
203199
packages.append(package)
200+
elif len(packageTuple) == 2:
201+
# The subrequires ask for a specific version
202+
packages.append(package)
204203

205204
def extractPackageName(packageString: str) -> str:
206205
return self.REZ_DELIMITER_PATTERN.split(packageString, maxsplit=1)[0]

0 commit comments

Comments
 (0)