Skip to content

docs: draft for plugin support with declarative config #2160

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

Closed
wants to merge 2 commits into from
Closed

Conversation

alvyjudy
Copy link
Contributor

on #2155

Summary of changes

I have worked out a draft to document the plugin support features in setuptools that covers the following:

  1. overview on making plugin for setuptools
  2. how to register commands (declarative and setup script)
  3. how to obtain parameters from the user's setup configuration (declarative and setup script)

Note that

  1. the declarative style documented here uses the setup.cfg file and I haven't figured out how to do this with pyproject.toml
  2. I have yet to test the examples given or make them self-contained
  3. It doesn't explain how things work under the hood since I feel that should be in a separate document (e.g. developer guide)

If this seems to be on the right track I'll be happy to finalize it:)

Pull Request Checklist

  • Changes have tests
  • News fragment added in changelog.d. See documentation for details

Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

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

I'm not sure we want to advertise this functionality. Much of the ecosystem has moved away from extending distutils and instead focuses on creating protocols for tools to build packages. If this functionality is documented, it probably should have a more compelling example.


What ``setuptools`` will then do is that it query the user's configuration
file or setup script, look for the keyword "supersdist_type", and pass its
value to the function ``parser`` located in ``keywords.py`` module. The value
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, the most important part of what happens is the parsed value is set on the dist object.

@@ -0,0 +1,117 @@
===============================
Building plugins for setuptools
Copy link
Member

Choose a reason for hiding this comment

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

Rather than speak about "plugins" generally, I would describe "extending Setuptools commands" or similar.

@alvyjudy
Copy link
Contributor Author

I might have misunderstood ticket #2155 or confused about the related context. Are the plugins we intend to describe best practice for not the ones I have documented in this file? Thanks in advance for clarifying that:)

@jaraco
Copy link
Member

jaraco commented Sep 4, 2020

I might have misunderstood ticket #2155 or confused about the related context. Are the plugins we intend to describe best practice for not the ones I have documented in this file? Thanks in advance for clarifying that:)

#2155 mentions #1055, wherein a new entry point (setuptools.finalize_distribution_options) in #1877 was added. The purpose of #2155 is to ensure that behavior is featured prominently as part of the command plugin functionality. I didn't realize that maybe command extensions wasn't already documented.

Ultimately, what #2155 is asking is to capture that setup_keywords is discouraged in favor of setuptools.finalize_distribution_options hooks that set values from configuration files.

@jaraco
Copy link
Member

jaraco commented Sep 4, 2020

I do apologize. The guidance in #2155 was pretty bad, and even as I'm reading it, I'm unsure what additional effort that ticket entailed. For now, I'm going to decline this PR and close #2155, as what's in master now is adequate.

@jaraco jaraco closed this Sep 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants