Skip to content

Conversation

@saikonen
Copy link
Collaborator

The current PyPI implementation can fail to produce a working environment in the case where the resolving machine is of a different architecture than the deployment target. Such a case is when any of the packages requested employs platform markers in their dependencies, as these depending on the value these can be ignored by the machine resolving the environment, but end up being required by the one executing the code.

PyTorch is one such library, where it specifies CUDA dependencies with the following constraints

; platform_system == \"Linux\" and platform_machine == \"x86_64\"

Resolving the environment on a machine not matching the above, all CUDA dependencies would end up not being shipped in the code package.
During execution though, torch would expect to find these, as the markers match the platform. This would lead to errors during runtime unless CUDA was provided by other means, f.ex. by the Docker base image being used.

@saikonen saikonen requested a review from savingoyal October 24, 2025 11:06
@saikonen saikonen marked this pull request as ready for review October 24, 2025 23:06
res["hash"] = vcs_info["commit_id"]
return res

from packaging.requirements import Requirement
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note implicit dependency on packaging. this is at least limited to only the solve step, but still not desirable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can vendor this lib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packaging is already vendored.

@romain-intel
Copy link
Contributor

So are you also re-exploring the patching approach?

@saikonen
Copy link
Collaborator Author

closing in favour of #2322

@saikonen saikonen closed this Oct 30, 2025
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.

4 participants