Skip to content

Add more flexibility in Distribution.finalize_options for plugins #4990

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

Open
jaraco opened this issue May 11, 2025 · 1 comment
Open

Add more flexibility in Distribution.finalize_options for plugins #4990

jaraco opened this issue May 11, 2025 · 1 comment
Assignees

Comments

@jaraco
Copy link
Member

jaraco commented May 11, 2025

In coherent-oss/coherent.licensed#1, I've touched on a limitation of the plugin integration for setuptools.finalize_distribution_options.

Although the integration allows for plugins to specify the "order" that these finalizers run, there are subsequent finalization actions that happen after the finalizers:

  • parsing config files
  • handling command line options

As a result, it's not possible for a plugin using this entry point to customize any behavior that relies on those settings.

I propose instead that parsing config files and command-line options should also be treated as finalizers so that their behavior can be integrated into the plugin mechanism.

@jaraco jaraco self-assigned this May 11, 2025
@abravalheri
Copy link
Contributor

I propose instead that parsing config files and command-line options should also be treated as finalizers so that their behavior can be integrated into the plugin mechanism.

This possibly requires changes in distutils.core.setup, which may be backwards incompatible (but it is hard to tell).

Have you considered introducing a new entry-point for this? This would be mostly backwards compatible. (I think that ideally we want to restrain the proliferation of entry-points and APIs, but in this case it may make sense).


On a related note:

In #2652 and #3415 a series of limitations and "wishes" about finalize_distribution_options, e.g., allowing finalizes to be opted-in/opted-out and passing configurations has been requested.

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

No branches or pull requests

2 participants