"env show --json" fails with an error if some plugin is not installed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 462
- Avg merge
- 19h 36m
- Merged PRs (30d)
- 10
Description
I am working on integrating Hatch in PyCharm and encountered an issue with the --json flag, which breaks our integration.
steps to reproduce:
-
hatch-container plugin is not installed
-
git clone https://github.com/ofek/hatch-showcase
-
➜ hatch-showcase git:(master) hatch env show --json
Environmentall.py3.7has unknown type: container -
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
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with hatch env show --json in the hatch-showcase repository while the hatch-container plugin is absent, then compare it with hatch env show. Trace the CLI path that formats environments as JSON; done means available environments are emitted in JSON without failing because an unavailable plugin-defined environment exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100