-
Notifications
You must be signed in to change notification settings - Fork 588
Add PEP 723 inline script metadata to example files #7717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit adds PEP 723 inline script metadata to all Python files in the examples/ and examples_trame/ directories. The metadata includes: - requires-python = ">=3.9" (matching project requirement) - dependencies list with third-party packages needed for each script This enables running examples as standalone scripts with PEP 723-compatible tools (like uv) that can automatically manage dependencies. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7717 +/- ##
=======================================
Coverage 96.38% 96.38%
=======================================
Files 150 150
Lines 32422 32422
Branches 4093 4093
=======================================
Hits 31250 31250
Misses 569 569
Partials 603 603 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds PEP 723 inline script metadata to all example Python scripts, listing Python version and dependencies.
- Inserts
# /// script
blocks after docstrings in bothexamples/
andexamples_trame/
directories - Automatically detects and lists third-party dependencies per script
- Ensures metadata follows PEP 723 placement (after docstring, before imports)
Reviewed Changes
Copilot reviewed 181 out of 181 changed files in this pull request and generated 2 comments.
File pattern | Description |
---|---|
examples_trame/**/*.py | Added PEP 723 metadata blocks to Trame examples |
examples/**/*.py | Added PEP 723 metadata blocks to PyVista examples |
Comments suppressed due to low confidence (1)
examples_trame/validation/many_actors.py:2
- No tests currently verify the presence or correctness of the PEP 723 metadata in example scripts. Adding a test to check these metadata blocks would catch regressions if the headers are modified or removed.
# requires-python = ">=3.9"
# /// script | ||
# requires-python = ">=3.9" | ||
# dependencies = [ | ||
# "pyvista", | ||
# "trame>=2.5.2", | ||
# ] | ||
# /// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The metadata block is duplicated across many example files. Consider automating its insertion via a build or templating step to reduce manual maintenance and ensure consistency.
# /// script | |
# requires-python = ">=3.9" | |
# dependencies = [ | |
# "pyvista", | |
# "trame>=2.5.2", | |
# ] | |
# /// |
Copilot uses AI. Check for mistakes.
# dependencies = [ | ||
# "matplotlib", | ||
# "pyvista", | ||
# "trame>=2.5.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Dependency version specifications currently use only lower bounds (e.g., "trame>=2.5.2"). Consider adding upper bounds (e.g., "trame<3.0") to avoid unexpected breakage from future major releases.
# "trame>=2.5.2", | |
# "trame>=2.5.2,<3.0", |
Copilot uses AI. Check for mistakes.
Summary
examples/
andexamples_trame/
directoriesuv
Changes Made
requires-python = ">=3.9"
matching project requirementsTest plan
🤖 Generated with Claude Code