Skip to content

Implement interface for calling PEP 517 hooks#732

Open
cottsay wants to merge 1 commit intomasterfrom
cottsay/hook_caller
Open

Implement interface for calling PEP 517 hooks#732
cottsay wants to merge 1 commit intomasterfrom
cottsay/hook_caller

Conversation

@cottsay
Copy link
Copy Markdown
Member

@cottsay cottsay commented Apr 1, 2026

This implementation is copied nearly verbatim from the prototype colcon_python_project package.

Here's the spec for PEP 517: https://peps.python.org/pep-0517/

This is the central component for enabling colcon to act as a "build frontend" and the Python package build process will be built around this infrastructure. Additionally, non-PEP 518 packages will extract package metadata during the identification and augmentation phases of the colcon workflow.

To help visualize where this fits in the overall standards-based Python build picture, this hook caller interface will invoke the appropriate backend hook (e.x. build_wheel) for a package to build a wheel file, and then colcon will install that wheel (after uninstalling any previous wheels for that package) into the install space.

The decoration infrastructure allows us to add backend-specific augmentations to hook invocations. Though this interface should allow colcon to support arbitrary backends, we'll implement decorators for "helping" the backends to support broader scenarios (like symlink installs) and optimize the overall process. For example, we'll need to augment setuptools builds in order to maintain feature parity with colcon's existing setuptools integration. We'll also use that decorator to move temporary artifacts out of the package source directory.

This implementation is copied nearly verbatim from the prototype
colcon_python_project package.
@cottsay cottsay self-assigned this Apr 1, 2026
@cottsay cottsay added the enhancement New feature or request label Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 94.81481% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.52%. Comparing base (b37a8d4) to head (6798cd6).

Files with missing lines Patch % Lines
...e/python_project/hook_caller_decorator/__init__.py 79.41% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #732      +/-   ##
==========================================
+ Coverage   87.21%   87.52%   +0.31%     
==========================================
  Files          69       73       +4     
  Lines        4106     4241     +135     
  Branches      709      720      +11     
==========================================
+ Hits         3581     3712     +131     
- Misses        414      420       +6     
+ Partials      111      109       -2     

☔ 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.

Comment thread test/test_flake8.py
Comment on lines +28 to +30
extend_ignore=[
'D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D106', 'D107',
],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added D106 to this list. Evidently we've never had a nested class definition in the test sources, but it makes sense to suppress the documentation requirement there as well.

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

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

1 participant