pypa/hatch

"env show --json" fails with an error if some plugin is not installed

Open

#2.011 geöffnet am 24. Juni 2025

Auf GitHub ansehen
 (12 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)Python (240 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (4.451 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 41T 22h) (20 gemergte PRs in 30 T)

Beschreibung

I am working on integrating Hatch in PyCharm and encountered an issue with the --json flag, which breaks our integration.

steps to reproduce:

  1. hatch-container plugin is not installed

  2. git clone https://github.com/ofek/hatch-showcase

  3. ➜ hatch-showcase git:(master) hatch env show --json Environment all.py3.7 has unknown type: container

  4. hatch-showcase git:(master) hatch env show Standalone ┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ Name ┃ Type ┃ Dependencies ┃ Scripts ┃ ┡━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩ │ default │ virtual │ coverage[toml]>=6.5 │ cov │ │ │ │ pytest │ cov-report │ │ │ │ │ test │ │ │ │ │ test-cov │ ├─────────┼─────────┼─────────────────────┼────────────┤ │ lint │ virtual │ black>=22.10.0 │ all │ │ │ │ mypy>=0.991 │ fmt │ │ │ │ ruff>=0.0.166 │ style │ │ │ │ │ typing │ └─────────┴─────────┴─────────────────────┴────────────┘ Matrices ┏━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ Name ┃ Type ┃ Envs ┃ Dependencies ┃ Scripts ┃ ┡━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩ │ all │ container │ all.py3.7 │ coverage[toml]>=6.5 │ cov │ │ │ │ all.py3.8 │ pytest │ cov-report │ │ │ │ all.py3.9 │ │ test │ │ │ │ all.py3.10 │ │ test-cov │ │ │ │ all.py3.11 │ │ │ └──────┴───────────┴────────────┴─────────────────────┴────────────┘

Expected Behaviour:

Hatch shows environments in json format, at least available ones

Contributor Guide