Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tkoyama010
Copy link
Member

@tkoyama010 tkoyama010 commented Jul 15, 2025

Summary

  • Added PEP 723 inline script metadata to all 181 Python files in examples/ and examples_trame/ directories
  • Each file now includes proper dependency declarations and Python version requirements
  • Enables running examples as standalone scripts with PEP 723-compatible tools like uv

Changes Made

  • Added metadata blocks with requires-python = ">=3.9" matching project requirements
  • Automatically detected and listed third-party dependencies for each script (pyvista, numpy, matplotlib, scipy, trame)
  • Placed metadata after docstrings but before imports as per PEP 723 specification
  • Excluded standard library imports from dependency lists

Test plan

  • Check that existing functionality is unchanged
  • Confirm metadata format follows PEP 723 specification

🤖 Generated with Claude Code

tkoyama010 and others added 2 commits July 16, 2025 06:44
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]>
@pyvista-bot pyvista-bot added documentation Anything related to the documentation/website bug Uh-oh! Something isn't working as expected. labels Jul 15, 2025
@tkoyama010 tkoyama010 removed the bug Uh-oh! Something isn't working as expected. label Jul 15, 2025
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.38%. Comparing base (f074ede) to head (a02a45d).
Report is 1 commits behind head on main.

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           

@tkoyama010 tkoyama010 requested a review from Copilot July 15, 2025 23:16
Copy link
Contributor

@Copilot Copilot AI left a 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 both examples/ and examples_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"

Comment on lines +1 to +8
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "pyvista",
# "trame>=2.5.2",
# ]
# ///

Copy link
Preview

Copilot AI Jul 15, 2025

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.

Suggested change
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "pyvista",
# "trame>=2.5.2",
# ]
# ///

Copilot uses AI. Check for mistakes.

# dependencies = [
# "matplotlib",
# "pyvista",
# "trame>=2.5.2",
Copy link
Preview

Copilot AI Jul 15, 2025

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.

Suggested change
# "trame>=2.5.2",
# "trame>=2.5.2,<3.0",

Copilot uses AI. Check for mistakes.

@tkoyama010 tkoyama010 marked this pull request as draft July 15, 2025 23:24
@pyvista-bot
Copy link
Contributor

@pyvista-bot pyvista-bot temporarily deployed to pull request July 16, 2025 01:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the documentation/website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants