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

When pyproject.toml contains errors, misleading message is shown #1777

Closed
2 tasks done
travishathaway opened this issue Aug 9, 2024 · 1 comment
Closed
2 tasks done
Labels
🐞 bug Something isn't working

Comments

@travishathaway
Copy link
Contributor

travishathaway commented Aug 9, 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

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.

@travishathaway travishathaway added the 🐞 bug Something isn't working label Aug 9, 2024
@Hofer-Julian Hofer-Julian changed the title When pyproject.toml contains errors, missleading message is shwon When pyproject.toml contains errors, misleading message is shown Aug 9, 2024
@ruben-arts
Copy link
Contributor

Fixed in #2075

Confirmed:

❯ pixi i
  × failed to parse project manifest
    ╭─[pyproject.toml:10:13]
  9 │ channels = ["conda-forge"]
 10 │ 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'
 11 │ 
    ╰────

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

2 participants