zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

support [tool:zest.releaser] in setup.cfg #371

Closed woutervh closed 1 year ago

woutervh commented 3 years ago

tools like pytest use a header [tool:pytest] in setup.cfg

` [tool:isort] ....

[tool:pep8] `

but zest.releaser breaks on this:
the setting python-file-with-version = src/mypackage/init.py is found with header [zest.releaser], and not found when using [tool:zest.releaser],

reinout commented 3 years ago

Well, it is not our documented header :-) But you're right that allowing (or even preferring) a tool-prefix is a good idea. I'll take a quick look.

reinout commented 3 years ago

Actually, it is pretty irritating to implement. There are quite some places where we have simple code like this:

    try:
        result = self._get_text(
            'zest.releaser', 'extra-message', default=default)
    except (NoSectionError, NoOptionError, ValueError):
        return default

So: we just try to grab the option and return a default upon an error. If we'd want to support both [zest.releaser] and [tool:zest.releaser], it would quickly turn into a mess. Or we'd have to re-do our parsing of the setup.cfg completely.

So for now I'd say we should just stick with [zest.releaser]. The "tools:" is just a recent convention, there's nothing broken by not implementing it. (At least, that's my impression at the moment).

reinout commented 1 year ago

@woutervh : now that we support pyproject.toml, there's a nice [tool.zest-releaser]. You only have to switch from setup.cfg to pyproject.toml, which is OK, I assume :-)

woutervh commented 1 year ago

Indeed, I switched to pyproject.toml for all my projects