pypa / pypa/setuptools

Support for custom build steps

Open
#2,591 6 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I've seen cases where users wish to add custom steps to the build process (example, example). Historically, users have managed to work around the issue by overriding the build or install commands (using cmdclass), but this approach requires replacing the default command just to inject some behavior. Preferable would be to avoid having to override the default behavior and for Setuptools to present a protocol for extending build steps.

And indeed, distutils already provides a mechanism to extend build steps through sub_commands.

My proposal is that the build command present an interface to append or prepend commands to the build subcommands such that a third-party provider could provide an independent command, expose it through distutils.commands, and either implicitly as part of the import or explicitly by the end user, append or prepend that command to the subcommands.

I think it should be possible to demonstrate this behavior today just by mutating the sub_commands list directly, though I'd probably recommend a proper API for users to use.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the distutils build command's sub_commands mechanism linked in the issue, then examine how Setuptools exposes the build command and existing cmdclass overrides. Define and demonstrate an interface that lets third-party or user-provided commands be appended or prepended to the build subcommands without replacing the default command.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.