Skip to content

Add no-default-feature = true to environment definition #1067

@pavelzw

Description

@pavelzw

Problem description

[project]
channels = ["conda-forge", "nvidia"]
platforms = ["linux-64", "win-64"]

[dependencies]
pytorch = "*"

[feature.lint]
channels = ["conda-forge"]
platforms = ["linux-64"]
[feature.lint.dependencies]
pre-commit = "*"

[feature.ruff]
platforms = ["linux-aarch64"]
[feature.ruff.dependencies]
ruff = "*"

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

This results in the following lint environment:

  • channels = ["conda-forge"] (union of channels from used features) (maybe there is a better solution for this?)
  • dependencies: ruff = "*", pre-commit = "*"
  • platforms = ["linux-aarch64", "linux-64"] (union of all platforms from used features) (maybe there is a better solution for this?)

I know originally I was opposed to this idea since you can represent this using an empty default feature set but I came to realize that this use actually happens quite often and restricting myself to an empty default feature set just because of this is annoying 😅

WDYT? cc @0xbe7a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions