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

fix: support adding dependencies for project's unsupported platforms #668

Conversation

orhun
Copy link
Contributor

@orhun orhun commented Jan 15, 2024

fixes #650

reproducible case (on Linux):

channels = ["conda-forge"]
platforms = [
  # "linux-64",
  "osx-arm64",
]
name = "bug"

[dependencies]
python = "=3.11.*"

Run:

$ pixi add --no-install ruff

 WARN pixi::environment: Adding dependency for unsupported platform (linux-64).
✔ Added ruff

ruff = ">=0.1.13,<0.2" added to pixi.toml 🎉

@ruben-arts
Copy link
Contributor

I think it would be nice to automate this when the current platform is not specified.
e.g.

[project]
name = "not_my_platform_project"
platforms = ["osx-arm64"]
channels = ["conda-forge"]

Would trigger the "--no-install" logic with that warning on the other platforms.

@orhun
Copy link
Contributor Author

orhun commented Jan 15, 2024

Do you mean running pixi add xyz on an unsupported platform would only add the dependency but not install it?

In that case we remove the "The project needs to be configured..." error, right?

@orhun
Copy link
Contributor Author

orhun commented Jan 15, 2024

I YOLO'd it in 1cce968

Let me know if the behavior is correct + if you like the mutable reference. (we can return bool from sanity_check_project instead)

@orhun orhun force-pushed the fix/support_adding_deps_for_unsupported_platform branch from 061bfe9 to 1cce968 Compare January 15, 2024 14:12
src/environment.rs Outdated Show resolved Hide resolved
src/environment.rs Outdated Show resolved Hide resolved
@orhun orhun requested a review from ruben-arts January 16, 2024 09:09
src/environment.rs Outdated Show resolved Hide resolved
@ruben-arts ruben-arts merged commit eec6d1f into prefix-dev:main Jan 16, 2024
4 checks passed
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.

pixi add only works on the project's supported platform
2 participants