Skip to content

Add support for "--variant -1" style syntax for rez-build#2103

Open
sanikache wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
dreamworksanimation:OSC-64
Open

Add support for "--variant -1" style syntax for rez-build#2103
sanikache wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
dreamworksanimation:OSC-64

Conversation

@sanikache
Copy link
Copy Markdown
Contributor

This pull request adds support for specifying negative variant indices (e.g., --variants -1) in rez build and copy workflows.
Negative indices are now accepted to select variants counting backward from the end, mirroring Python’s negative indexing convention.

Signed-off-by: Ibrahim Sani <Ibrahim.Sani@dreamworks.com>
@sanikache sanikache requested a review from a team as a code owner May 14, 2026 18:26
@maxnbk maxnbk added the devdays26 ASWF Dev Days 2026 label May 14, 2026
@maxnbk
Copy link
Copy Markdown
Contributor

maxnbk commented May 14, 2026

One failing test in the jobs, that I see at a glance (I pulled linux 3.10 as a sample)

FAILED installdir/lib/python3.10/site-packages/rez/tests/test_context.py::TestContext::test_bundled - rez.exceptions.PackageCopyError: The package does not contain the variants: None

@sanikache
Copy link
Copy Markdown
Contributor Author

Taking a look . .

@sanikache
Copy link
Copy Markdown
Contributor Author

It's the change in package_copy.py that's breaking test_context.py::TestContext::test_bundled . It will fail for packages with no declared variants. Pushing a commit for that shortly.

Signed-off-by: Ibrahim Sani <Ibrahim.Sani@dreamworks.com>
@sanikache
Copy link
Copy Markdown
Contributor Author

It looks like there is no test for copy_package on a non-variants package. I added one to cover that.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.70%. Comparing base (d415b96) to head (2bdc56c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2103      +/-   ##
==========================================
+ Coverage   60.65%   60.70%   +0.04%     
==========================================
  Files         164      164              
  Lines       20584    20594      +10     
  Branches     3579     3585       +6     
==========================================
+ Hits        12485    12501      +16     
+ Misses       7224     7219       -5     
+ Partials      875      874       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxnbk
Copy link
Copy Markdown
Contributor

maxnbk commented May 15, 2026

Overall I'm happy, I would ask the question if maybe, since the build_process and package_copy is almost the same, if there is a sane/easy way to extract, put the variant-counting/set/invalid logic in a shared location, and call it, but the code is subtly different so perhaps it would not be completely simple? Happy to discuss.

@sanikache
Copy link
Copy Markdown
Contributor Author

For sure, let me take a look . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devdays26 ASWF Dev Days 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants