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

system-requirements ignored when using no-default-feature = true #1549

Closed
2 tasks done
pavelzw opened this issue Jun 28, 2024 · 5 comments
Closed
2 tasks done

system-requirements ignored when using no-default-feature = true #1549

pavelzw opened this issue Jun 28, 2024 · 5 comments
Labels
🐞 bug Something isn't working

Comments

@pavelzw
Copy link
Contributor

pavelzw commented Jun 28, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

[project]
name = "my-project"
channels = ["conda-forge"]
platforms = ["linux-64"]

[system-requirements]
linux = "4.18.0"

[dependencies]
python = "*"

[feature.lint.dependencies]
ruff = "*"

[environments]
lint = { features = ["lint"], no-default-feature = true }

Issue description

When running pixi run -e lint ruff --version, i get the error

The current system has a mismatching virtual package. The project requires '__linux' to be at least version '5.10' but the system has version '4.18.0'

Expected behavior

IMO it would be more sensible if system-requirements would be included in the default feature similar to channels and platforms.

WDYT?

@pavelzw pavelzw added the 🐞 bug Something isn't working label Jun 28, 2024
@pavelzw
Copy link
Contributor Author

pavelzw commented Jun 28, 2024

Although, with packages Like cuda this light be Not as clear… lets keep the behavior as is

@pavelzw pavelzw closed this as completed Jun 28, 2024
@noamgot
Copy link
Contributor

noamgot commented Dec 31, 2024

I just realized that the problem I mentioned in #346 (comment) occurs due to my environment having no-default-feature = true, but I don't understand why does it make sense?

@ruben-arts
Copy link
Contributor

@noamgot all tables are part of the "default" feature if they are not specified specifically. e.g. [system-requirements] could be read as [feature.default.system-requirements]

I've improved the debugablity of the system requirements by adding them to pixi info in #2753. I hope that helps

@noamgot
Copy link
Contributor

noamgot commented Jan 3, 2025

@ruben-arts I now understand this technically, but shouldn't some tables be "project-global"?

In my vase, I set no-default-feature = true for a lint environment, as I wanted to exclude the package dependencies, which are irrelevant for linting. Obviously, I want to keep it that way, but then I'll have to set the system-requirements for every feature (that relates to no-default-feature environment). Is there a best practice to handle this?

@noamgot
Copy link
Contributor

noamgot commented Feb 13, 2025

UPDATE: as a workaround I did the following:

[tool.pixi.feature.sysreq.system-requirements]
linux = "4.15"

[tool.pixi.environments]
default = { features = ["sysreq", "test", "dev"], solve-group = "default" }
test = { features = ["sysreq", "test"], solve-group = "default" }
prod = { features = ["sysreq", "prod"], solve-group = "default" }
lint = { features = ["sysreq", "lint"], no-default-feature = true }
docs = { features = ["sysreq", "docs"], no-default-feature = true }

This way I define the system-requirements just once, and it's available for all environments (that was enough for my case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants