Skip to content

feat: Add Python Virtual Environment Support: Installing User Defined Packages#4902

Open
SarahAsad23 wants to merge 19 commits intoapache:mainfrom
SarahAsad23:pve-add-user-packages
Open

feat: Add Python Virtual Environment Support: Installing User Defined Packages#4902
SarahAsad23 wants to merge 19 commits intoapache:mainfrom
SarahAsad23:pve-add-user-packages

Conversation

@SarahAsad23
Copy link
Copy Markdown
Contributor

@SarahAsad23 SarahAsad23 commented May 4, 2026

What changes were proposed in this PR?

This PR is an extension of PR #4484. Previously, we introduced support for creating Python Virtual Environments (PVEs) with system-level dependencies preinstalled. This PR builds on that foundation by enabling users to install custom Python packages within a PVE.

Some duplicate lines of code (previously introduced in PR #4484) were removed from PveManager to improve clarity and reduce redundancy.

Any related issues, documentation, discussions?

This change is part of ongoing efforts to support environment isolation and reproducibility within Texera. Related issue includes #4296. This PR closes sub-issue #4465.

How was this PR tested?

Tested Manually and PveResourceSpec test file updated.
To test:

  1. On CU click "+" Python Environments.
  2. Input environment name.
  3. Input package name and version.
  4. Click "OK" and wait for pip logs.

Was this PR authored or co-authored using generative AI tooling?

Co-authored using: ChatGPT (OpenAI)

@github-actions github-actions Bot added engine frontend Changes related to the frontend GUI labels May 4, 2026
@chenlica chenlica requested a review from kunwp1 May 4, 2026 14:48
Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 left a comment

Choose a reason for hiding this comment

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

The feature is working well! I left a few comments to improve the codebase and user experience.

};

socket.onerror = err => {
console.log("PVE WS error", err);
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.

Revert this change?

};
});

socket.onclose = event => {
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.

Revert this change?

this.scrollToBottomOfPipModal(index);

socket.onmessage = event => {
console.log("PVE WS received:", event.data);
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.

Revert this change?

@SarahAsad23 SarahAsad23 requested a review from kunwp1 May 4, 2026 21:32
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

❌ Patch coverage is 22.90076% with 101 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.11%. Comparing base (c533305) to head (c51f962).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...power-button/computing-unit-selection.component.ts 0.00% 56 Missing ⚠️
...wer-button/computing-unit-selection.component.html 0.00% 32 Missing ⚠️
...resource/pythonvirtualenvironment/PveManager.scala 76.92% 7 Missing and 2 partials ⚠️
...virtual-environment/virtual-environment.service.ts 0.00% 2 Missing ⚠️
...esource/pythonvirtualenvironment/PveResource.scala 0.00% 1 Missing ⚠️
...ythonvirtualenvironment/PveWebsocketResource.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4902      +/-   ##
============================================
- Coverage     42.15%   42.11%   -0.05%     
- Complexity     2179     2181       +2     
============================================
  Files           980      980              
  Lines         36298    36383      +85     
  Branches       3783     3793      +10     
============================================
+ Hits          15303    15321      +18     
- Misses        20066    20134      +68     
+ Partials        929      928       -1     
Flag Coverage Δ
amber 43.18% <73.17%> (+0.06%) ⬆️
frontend 30.36% <0.00%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 left a comment

Choose a reason for hiding this comment

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

Left a few more comments.

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 it's better to make the layout of showing user packages to be consistent with showing system packages: Showing one header followed by multiple packages

Image

return {
name: name.trim(),
operator: "==" as const,
version: (version ?? "").trim(),
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.

Is it possible to show a version installed if the user doesn't specify a version? I don't like keeping it empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants