-
Notifications
You must be signed in to change notification settings - Fork 358
Improve package repository case insensitive error handling #1974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JeanChristopheMorinPerso
merged 13 commits into
AcademySoftwareFoundation:main
from
BryceGattis:hotfix/create_variant_case_mismatch_handling
Jun 21, 2025
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
011b52f
Add failing test case
BryceGattis 4c78a84
Fix flake8 issue
BryceGattis 58fcb61
Add fix for the lack of error handling
BryceGattis d0daca8
Update src/rez/tests/test_package_respository.py
BryceGattis 3c68222
Update src/rez/tests/test_package_respository.py
BryceGattis f70e059
Fix issue with util tests where they weren't cleaning up their temp f…
BryceGattis e291e32
Merge branch 'hotfix/create_variant_case_mismatch_handling' of https:…
BryceGattis 98f5d75
Fix name of new test file
BryceGattis d5745a8
Merge branch 'main' into hotfix/create_variant_case_mismatch_handling
JeanChristopheMorinPerso 193a216
Merge branch 'main' into hotfix/create_variant_case_mismatch_handling
JeanChristopheMorinPerso 2dd4830
Merge branch 'main' into hotfix/create_variant_case_mismatch_handling
JeanChristopheMorinPerso f5c83d0
Merge branch 'main' into hotfix/create_variant_case_mismatch_handling
JeanChristopheMorinPerso ebbba37
Merge branch 'main' into hotfix/create_variant_case_mismatch_handling
JeanChristopheMorinPerso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright Contributors to the Rez Project | ||
|
|
||
|
|
||
| """ | ||
| Test package repository plugin. | ||
| """ | ||
| import unittest | ||
|
|
||
| from rezplugins.package_repository import filesystem | ||
| from rez.packages import create_package | ||
| from rez.tests.util import TestBase, TempdirMixin | ||
| from rez.utils.platform_ import platform_ | ||
|
|
||
|
|
||
| class TestFilesystemPackageRepository(TestBase, TempdirMixin): | ||
| ```? | ||
| @classmethod | ||
| def setUpClass(cls): | ||
| TempdirMixin.setUpClass() | ||
|
|
||
| cls.settings = dict() | ||
|
|
||
| @classmethod | ||
| def tearDownClass(cls): | ||
| TempdirMixin.tearDownClass() | ||
|
|
||
| @unittest.skipIf(platform_.name != "windows", | ||
| "Skipping because this issue only affects case-insensitive platforms.") | ||
| def test_mismatching_case(self): | ||
| """Test that we get a caught PackageRepositoryError on case-insensitive platforms.""" | ||
| pool = filesystem.ResourcePool(cache_size=None) | ||
| pkg_repository = filesystem.FileSystemPackageRepository(self.root, pool) | ||
|
|
||
| package = create_package("myTestPackage", data={}) | ||
| variant = next(package.iter_variants()) | ||
| case_mismatch_package = create_package("MyTestPackage", data={}) | ||
| case_mismatch_variant = next(case_mismatch_package.iter_variants()) | ||
|
|
||
| pkg_repository._create_variant(variant, overrides={}) | ||
JeanChristopheMorinPerso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with self.assertRaises(filesystem.PackageRepositoryError): | ||
| pkg_repository._create_variant(case_mismatch_variant, overrides={}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.