Skip to content

Feature/issue 1100 provides#2137

Open
manuelkoester wants to merge 11 commits into
AcademySoftwareFoundation:mainfrom
manuelkoester:feature/issue_1100_provides
Open

Feature/issue 1100 provides#2137
manuelkoester wants to merge 11 commits into
AcademySoftwareFoundation:mainfrom
manuelkoester:feature/issue_1100_provides

Conversation

@manuelkoester

Copy link
Copy Markdown

.provides.* ephemerals

The goal of the provides feature is to be able to describe one package being bundled or provided by another. Therefore if a provides package is encountered it would be resolved & used in lieu of its possibly real package counterpart

This is especially usefull for things like DCCs which tend to ship a lot of their libraries/interpreters bundled as part of themselves. Houdini example: https://www.sidefx.com/docs/houdini/licenses/index.html
Before this there was no clean way to tell rez "this app already has python, do not pull in the actual python package"

I've opted to implement this feature via ephemerals and not an explicit package attribute like provides = [..] as with ephemerals it direclty works for variants and it also doesn't need an additional concept in the solver

To add a provided package to a package you add the provided package to the requirements and prefix it with .provides.

How it behaves

A package that bundles its own python:

name = 'maya'

requires = [
    '.provides.python-2.7.11'
]

Any request for the provided package that intersects the provided range gets satisfied by the provider.
The real package is not resolved, doesn't show up in the resolved list, and doesn't even need to exist in a repo.
The .provides.* ephemeral itself stays visible in the resolve:

$ rez-env maya my_python_tool
...
resolved packages:
.provides.python-2.7.11  (provided)
maya-2020                /pkgs/maya/2020
my_python_tool-1.0.0     /pkgs/my_python_tool/1.0.0

A request outside the provided range is a conflict, not a second python:

$ rez-env maya python-3
The context failed to resolve:
The following package conflicts occurred: (.provides.python-2.7.11 <--!--> python-3)

These are just normal package requests, so users can pass them too:
rez-env '.provides.python-3.7' my_tool ~ "python is on the system"

For more examples take a look at the tests in test_solver.py

Open questions

I'm not sure how we should handle multiple providers for teh same package. Currently it does resolve and just lets all providers provide the package (test covered in test_solver.py)

I'm also generally interested if people think this is the way to go about it

Additional Ref / discussion dump

@manuelkoester manuelkoester requested a review from a team as a code owner June 20, 2026 22:10
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 20, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@manuelkoester manuelkoester force-pushed the feature/issue_1100_provides branch from a97b06b to 9d9cbb2 Compare June 22, 2026 13:32
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
…tion tests

Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
…as wanted yet. but at least has coverage now

Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
Signed-off-by: Manuel Köster <manuelkoestercg@gmail.com>
@manuelkoester manuelkoester force-pushed the feature/issue_1100_provides branch from 9d9cbb2 to a63fa69 Compare July 1, 2026 08:43
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.48148% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.42%. Comparing base (6654418) to head (a63fa69).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/rez/resolved_context.py 8.33% 9 Missing and 2 partials ⚠️
src/rez/solver.py 94.20% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2137      +/-   ##
==========================================
+ Coverage   61.32%   61.42%   +0.10%     
==========================================
  Files         164      164              
  Lines       20568    20637      +69     
  Branches     3575     3598      +23     
==========================================
+ Hits        12613    12676      +63     
- Misses       7084     7087       +3     
- Partials      871      874       +3     

☔ View full report in Codecov by Harness.
📢 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant