Skip to content

Migrate plugin Python package management from pip3 to uv#2902

Merged
mcosgriff merged 1 commit into
mainfrom
python-plugin-still-using-pip
Mar 2, 2026
Merged

Migrate plugin Python package management from pip3 to uv#2902
mcosgriff merged 1 commit into
mainfrom
python-plugin-still-using-pip

Conversation

@mcosgriff
Copy link
Copy Markdown
Contributor

@mcosgriff mcosgriff commented Mar 2, 2026

  • Replaced the pip3 calls with uv pip
  • Using uv to create the virtual environment at ${PYTHONUSERBASE}
/gems $ tree /gems/uv
/gems/uv
├── CACHEDIR.TAG
├── interpreter-v4
│   └── 4c6c6b68efe0f91a
│       └── 9956a7adb4259607.msgpack
└── sdists-v9

3 directories, 2 files

Known behavior change: Plugin Python packages that are already present in the base openc3 venv (e.g. numpy) will no longer appear in Admin Console → Packages after plugin installation. uv pip is smarter than pip3 about deduplication and skips installing packages that are already satisfied, so nothing gets written to $PYTHONUSERBASE. The packages are still fully accessible to plugin scripts via OPENC3_PYTHON_BIN. This will be properly addressed in the upcoming per-plugin venv refactor.

…env to create the plugin venv and --python to target it directly without requiring shell activation.

- Set UV_CACHE_DIR to /gems/uv/ so the runtime uv cache persists on the gems volume across container restarts.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 2, 2026

Comment thread openc3/Dockerfile
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.29%. Comparing base (397abec) to head (71a9261).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2902      +/-   ##
==========================================
- Coverage   78.29%   78.29%   -0.01%     
==========================================
  Files         673      673              
  Lines       55130    55130              
  Branches      728      728              
==========================================
- Hits        43164    43163       -1     
- Misses      11888    11889       +1     
  Partials       78       78              
Flag Coverage Δ
python 79.34% <ø> (+<0.01%) ⬆️
ruby-api 80.10% <ø> (-0.05%) ⬇️
ruby-backend 82.18% <ø> (ø)

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.

@mcosgriff mcosgriff marked this pull request as ready for review March 2, 2026 20:49
@mcosgriff mcosgriff requested a review from jmthomas March 2, 2026 20:51
Copy link
Copy Markdown
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

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

You make a good point. We'll have to think about the UI implications of listing the dependencies for each plugin rather than in a huge generic list.

@mcosgriff
Copy link
Copy Markdown
Contributor Author

You make a good point. We'll have to think about the UI implications of listing the dependencies for each plugin rather than in a huge generic list.

Something like in admin console

// Before
{
  "ruby": ["activesupport-7.0.0.gem"],
  "python": ["numpy-1.24.0", "pandas-2.0.1"]
}

// After
{
  "ruby": ["activesupport-7.0.0.gem"],
  "python": {
    "openc3-cosmos-demo": ["numpy-1.24.0", "pandas-2.0.1"],
    "my-custom-plugin": ["requests-2.31.0"]
  }
}

@mcosgriff mcosgriff merged commit de86942 into main Mar 2, 2026
30 of 33 checks passed
@mcosgriff mcosgriff deleted the python-plugin-still-using-pip branch March 2, 2026 23:04
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.

2 participants