praiskup / argparse-manpage

Automatically build man-pages for your Python project
Apache License 2.0
40 stars 21 forks source link

Please remove the need for `setup.py` #85

Closed rrthomas closed 11 months ago

rrthomas commented 1 year ago

It shouldn't be necessary to write the standard boilerplate in setup.py if one is using argparse-manpage in the default way.

marcelzwiers commented 1 year ago

I think this is currently the minimal setup.py that is required:

from setuptools import setup
from build_manpages import build_manpages, get_build_py_cmd, get_install_cmd

setup(cmdclass = {'build_manpages': build_manpages,
                  'build_py': get_build_py_cmd(),
                  'install': get_install_cmd()})

I believe this is because setuptools does not (yet?) support the use of cmdclass in pyproject.toml (see e.g. https://github.com/pypa/packaging-problems/issues/657)

praiskup commented 11 months ago

I successfully tested:

[tool.setuptools.cmdclass]
build_py = "_custom_build.build_py"
build_manpages = "build_manpages.build_manpages"

With _custom_build.py file:

from build_manpages import get_build_py_cmd
build_py = get_build_py_cmd()
rrthomas commented 11 months ago

Thanks very much for continuing to work on this, @praiskup, that looks like a substantial improvement. I look forward to trying it myself the next time I make a release!

praiskup commented 11 months ago

104 provides even more convenience, and documentation