collective / zestreleaser.towncrier

GNU General Public License v2.0
1 stars 1 forks source link

Use python -m towncrier #17

Closed mauritsvanrees closed 5 years ago

mauritsvanrees commented 5 years ago

Instead of locating a towncrier executable, which may involve trickery and magic, we may be able to call python -m towncrier. So instead of this:

path = check_towncrier(data)
if not path:
    return
cmd = [path, '--version', data['new_version'], '--yes']

we could maybe do this:

cmd = [sys.executable, '-m', 'towncrier', '--version', data['new_version'], '--yes']

We could also make this one of the fallbacks in our _towncrier_executable function.

This might have helped with issue #6.

mauritsvanrees commented 5 years ago

I notice that with a buildout section like this, the towncrier script is not actually installed:

[releaser]
recipe = zc.recipe.egg
eggs =
    zest.releaser[recommended]
    zestreleaser.towncrier

Solution: either add towncrier to that list explicitly, or add an option to that section:

dependent-scripts = true

This is another reason why it would be helpful to call python -m towncrier: then it does not matter that the script is not installed.

mauritsvanrees commented 5 years ago

Fix released in 1.2.0.