hatch-fancy-pypi-readme icon indicating copy to clipboard operation
hatch-fancy-pypi-readme copied to clipboard

Support use as pdm-backend plugin

Open dairiki opened this issue 1 year ago • 10 comments

This PR adds support for using hatch-fancy-pypi-readme as a PDM-backend plugin.

I was looking for a plugin exactly like this one, except to use with pdm-backend instead of hatchling. As it turns out, adding a pdm-backend plugin was pretty straight-forward.

I also decided to dynamically switch the pyproject.toml key where the plugin finds its configuration table depending on the build backend. Now when build-system.build-backend is set to pdm.backend, the configuration now gets pulled from tool.pdm.build.hooks.hatch-fancy-pypi-readme (rather than tool.hatch.metadata.hooks.fancy-pypi-readme). This switch markedly increases the diff count of the PR, however it seems to me that the potential for confusion if a pdm-backend plugin pulls its configuration from tool.hatch.* is large, so the extra mess is worth it.

dairiki avatar Nov 11 '23 02:11 dairiki