Skip to content

API: create environment with name - #1802

Open
Eduardo Villalpando Mello (edvilme) wants to merge 7 commits into
mainfrom
api-environment-name
Open

Eduardo Villalpando Mello (edvilme) wants to merge 7 commits into
mainfrom
api-environment-name

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

This pull request introduces a new optional name field to the CreateEnvironmentOptions for the @vscode/python-environments API, allowing API consumers to specify a desired environment name when creating Python environments. The implementation ensures that provided names are validated and integrated into both venv and conda environment creation flows. Documentation and versioning are updated accordingly.

API and Documentation Updates:

  • Added an optional name property to CreateEnvironmentOptions, enabling consumers to request a specific environment name during creation. The documentation (docs/README.md) and changelog (api/CHANGELOG.md) are updated to reflect this new feature. [1] [2] [3] [4]

  • Bumped package version to 1.5.0 in package.json and package-lock.json. [1] [2]

Validation and Core Logic:

  • Implemented validation for the name field to ensure it is a non-empty path segment and does not contain invalid characters (e.g., ., .., /, This pull request introduces a new optional namefield to theCreateEnvironmentOptionsfor the@vscode/python-environments` API, allowing API consumers to specify a desired environment name when creating Python environments. The implementation ensures that provided names are validated and integrated into both venv and conda environment creation flows. Documentation and versioning are updated accordingly.

API and Documentation Updates:

  • Added an optional name property to CreateEnvironmentOptions, enabling consumers to request a specific environment name during creation. The documentation (docs/README.md) and changelog (api/CHANGELOG.md) are updated to reflect this new feature. [1] [2] [3] [4]

  • Bumped package version to 1.5.0 in package.json and package-lock.json. [1] [2]

Validation and Core Logic:

, or null bytes).

Venv Environment Creation:

  • Updated venv creation flows to accept and use the supplied name, including validation for existing directories and proper handling in both quick and step-based flows. The state management is enhanced to track if the name was supplied by the user. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Conda Environment Creation:

  • Extended conda environment creation flows to support the optional name parameter, ensuring correct flow control, state management, and back-navigation logic. The implementation also ensures that the environment is created with the requested name if provided. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

@edvilme Eduardo Villalpando Mello (edvilme) added the feature-request Request for new features or functionality label Sep 22, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) marked this pull request as ready for review September 22, 2026 16:42
Comment thread docs/README.md Outdated
Comment thread src/managers/builtin/venvStepBasedFlow.ts
@bschnurr

Bill Schnurr (bschnurr) commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the name needs to be validated to contain allowed path characters.

For example, I don't think a name of ..\..\ would work very well.

Comment thread src/extensionApi.ts Outdated

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Sep 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a9796987-f9b0-451b-a3cd-35d8a950eac8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a9796987-f9b0-451b-a3cd-35d8a950eac8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants