Skip to content
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

Cross-platform support #2079

Closed
michaelboyd2 opened this issue Feb 29, 2024 · 1 comment · Fixed by #3154
Closed

Cross-platform support #2079

michaelboyd2 opened this issue Feb 29, 2024 · 1 comment · Fixed by #3154
Assignees
Labels
enhancement New feature or improvement to existing functionality

Comments

@michaelboyd2
Copy link

My goal is to support building OCI (docker) images for a platform other than the host platform.

For reasons related to our tooling (we use Bazel and want hermetic builds), we do not want to do this via running pip install commands on the image itself (as would be normal in a Dockerfile).

The solution we have now is to download wheels for different platforms using pip download --platform. We can then pass the appropriate target depending on which platform we are building for. This method has the downside that we need appropriate wheels to exist for the packages we want to use (this sometimes involves creating our own).

Is there any way to achieve my goal with uv? Support for uv pip download --platform would be sufficient, but it would be ideal to be able to not need the wheels. uv pip install --platform or similar would be even better (no idea if this is at all feasible).

@konstin konstin added the enhancement New feature or improvement to existing functionality label Mar 1, 2024
@fullerzz
Copy link

I would definitely use uv pip install --platform if implemented! My current use case involves downloading python dependencies with pip install -r requirements.txt --platform manylinux2014_aarch64.

These deps are then zipped and uploaded to AWS as a lambda layer. The lambdas using the layer run on the AWS managed Python 3.11 runtime with ARM architecture.

One of my dependencies is lxml which is what required me to add the --platform manylinux2014_aarch64 option initially.

I'm a big fan of Ruff, so I'm hoping I can start to make use of uv more too.

@charliermarsh charliermarsh self-assigned this Apr 19, 2024
charliermarsh added a commit that referenced this issue Apr 22, 2024
## Summary

pip supports providing a `--platform` to `pip install`, which can be
used to seed an environment (e.g., for use in a container or otherwise).
This PR adds `--python-platform` to our commands to support a similar
workflow. It has some caveats, which are documented on the CLI.

Closes #2079.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants