prefix-dev / pixi

Package management made easy

Home Page:https://pixi.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When `pyproject.toml` contains errors, misleading message is shown

travishathaway opened this issue · comments

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

With the following pyproject.toml defined:

[project]
name = "test"
version = "0.1.0"
description = "test"
requires-python = ">=3.8"
dependencies = []

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64", "osx-64", "linux-64", "linux-arm64", "win-64"]

[tool.pixi.dependencies]
conda = "*"

[tool.pixi.pypi-dependencies]
test = { path = ".", editable = true }

When I run the following command:

pixi install

The following is shown:

  × could not find pixi.toml or pyproject.toml which is configured to use pixi

There's an error with the pyproject.toml file configuration which is shown if run this command:

$ pixi init --format pyproject
  × TOML parse error at line 34, column 13
  │    |
  │ 34 | platforms = ["osx-arm64", "osx-64", "linux-64", "linux-arm64", "win-64"]
  │    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  │ 'linux-arm64' is not a known platform. Valid platforms are 'noarch', 'unknown', 'linux-32', 'linux-64', 'linux-aarch64', 'linux-armv6l',
  │ 'linux-armv7l', 'linux-ppc64le', 'linux-ppc64', 'linux-s390x', 'linux-riscv32', 'linux-riscv64', 'osx-64', 'osx-arm64', 'win-32', 'win-
  │ 64', 'win-arm64', 'emscripten-wasm32', 'wasi-wasm32', 'zos-z'
  │

Issue description

Please see above.

Expected behavior

I would expect that pixi install would also error loudly so that it's obvious what I should fix. This was pretty confusing for me as I was first editing my existing pyproject.toml to be used with pixi.