Skip to content

Add explicit PEP 723 script environment setup (preview) - #5

Closed
StellaHuang95 wants to merge 2 commits into
mainfrom
pep723-pr9-routing
Closed

Add explicit PEP 723 script environment setup (preview)#5
StellaHuang95 wants to merge 2 commits into
mainfrom
pep723-pr9-routing

Conversation

@StellaHuang95

@StellaHuang95 StellaHuang95 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fork-review PR for a deliberately limited, default-off feedback rollout.

This replaces the earlier automatic-routing implementation with an explicit setup command. It intentionally does not implement the full roadmap PR9 design.

What this preview does

Adds Python: Set Up Environment for Inline Script (python-envs.setupInlineScriptEnvironment).

The command:

  1. uses a supplied local .py URI or the active editor;
  2. fails fast when the inline-script preview flag is disabled;
  3. requires the open document to be saved;
  4. validates saved on-disk PEP 723 metadata;
  5. waits for the inline manager's bounded registration readiness;
  6. calls InlineScriptEnvManager.create(uri) so current dependencies and requires-python select/reuse the correct cache entry;
  7. calls setEnvironment(uri, environment, false) so PR7 persists the per-script association and activates it for the current session without writing project settings.

A failed or cancelled setup leaves the prior association unchanged. Repeated setup is intentional: it lets metadata changes select a new cache entry without adding automatic metadata watchers.

Intentional limitations

  • no implicit automatic routing;
  • no routing registry or new Memento schema;
  • no sidecar provenance or migration machinery;
  • no per-script pythonProjects[] registration;
  • no CodeLens, picker row, or bulk setup;
  • after reload or metadata changes, users may need to invoke setup again;
  • feature remains behind python-envs.inlineScripts.enabled.

These limitations keep the first feedback rollout reversible and reduce regression risk.

Size

  • production: 108 additions, 0 deletions across four production files
  • tests/wiring: focused command and registration coverage

Validation

  • TypeScript test compilation
  • ESLint
  • focused command suite: 15 passing
  • four manual review passes; no significant findings remain

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
@StellaHuang95
StellaHuang95 marked this pull request as ready for review August 17, 2026 17:10
@StellaHuang95 StellaHuang95 added review-auto:changes-requested Automated review: posted blocking findings to address. review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. review-auto:approved Automated review: no blocking findings (approval posted). labels Aug 17, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
@StellaHuang95 StellaHuang95 changed the title Route PEP 723 scripts to inline environments (PEP 723 PR 9/16) Add explicit PEP 723 script environment setup (preview) Aug 17, 2026
@StellaHuang95 StellaHuang95 added the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 17, 2026
@StellaHuang95

Copy link
Copy Markdown
Owner Author

Closing this PR in favor of a clean-history replacement with the same current reviewed file changes.

@StellaHuang95

Copy link
Copy Markdown
Owner Author

Superseded by clean-history replacement #7.

@StellaHuang95 StellaHuang95 removed the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant