microsoft / microsoft/vscode-python-environments

More gracefully fail on `pyproject.toml` error

Open
#411 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug verified
Dominant language
TypeScript
Stars
138
Forks
62
Avg merge
1d 4h
Merged PRs (30d)
35

Description

tried going through the "create environment..." flow with a pyproject.toml file but I had an error since my pyproject.toml file was incorrectly formatted. Would be good if the error message was better or it failed more gracefully

 Resolved Python Environment /Users/eleanorboyd/python-envs-scenarios/existing-env-folder/.venv/bin/python
2025-05-14 09:19:39.308 [info] Running: uv pip install --python /Users/eleanorboyd/python-envs-scenarios/existing-env-folder/.venv/bin/python -e /Users/eleanorboyd/python-envs-scenarios/existing-env-folder
2025-05-14 09:19:39.378 [info] error: Failed to extract static metadata from `pyproject.toml`
  Caused by: TOML parse error at line 6, column 8
  |
6 | name = "existing env folder"
  |        ^^^^^^^^^^^^^^^^^^^^^
Not a valid package or extra name: "existing env folder". Names must start and end with a letter or digit and may only contain -, _, ., and alphanumeric characters.


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the "create environment..." flow and the logged uv pip install --python ... -e ... invocation, using the malformed pyproject.toml example to reproduce the failure. Done means the flow reports the package metadata error more clearly or exits gracefully instead of exposing the raw failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.