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

fullrelease: error: no such option: --no-input #392

Closed icemac closed 1 year ago

icemac commented 1 year ago

Calling fullrelease --no-input leads to the following error message:

$ fullrelease --no-input
INFO: Starting prerelease.
Usage: fullrelease [options] <directories>

fullrelease: error: no such option: --no-input

But it is listed in --help:

$ fullrelease --help
usage: fullrelease [-h] [--no-input] [-v]

optional arguments:
  -h, --help     show this help message and exit
  --no-input     Don't ask questions, just use the default values
  -v, --verbose  Verbose mode

Calling fullrelease without options still works but it is tedious to hit enter all the time.

I am using zest.relaser == 7.0.0

Other versions used:

$ bin/python -V
Python 3.9.13
$ bin/python -m pip freeze
bleach==4.1.0
build==0.7.0
certifi==2021.10.8
chardet==4.0.0
charset-normalizer==2.0.7
check-manifest==0.47
colorama==0.4.4
docutils==0.18.1
idna==3.3
importlib-metadata==4.8.2
keyring==23.2.1
packaging==21.3
pep440==0.1.1
pep517==0.12.0
pkginfo==1.8.1
Pygments==2.10.0
pyparsing==3.0.6
pyroma==4.0b1
python-gettext==4.1
readme-renderer==30.0
requests==2.26.0
requests-toolbelt==0.9.1
rfc3986==1.5.0
six==1.16.0
toml==0.10.2
tomli==1.2.2
tqdm==4.62.3
twine==3.6.0
urllib3==1.26.7
webencodings==0.5.1
zest.pocompile==1.5.0
zest.releaser==7.0.0
zipp==3.6.0
reinout commented 1 year ago

Really weird? The option is there for me, I just checked it on the command line in a test project. And it's there in the code: https://github.com/zestsoftware/zest.releaser/blob/master/zest/releaser/utils.py#L235 That part of the code hasn't been touched in 7 years time :-)

So... real weird. Some things to try:

icemac commented 1 year ago

The error happened when releasing zope.app.locales which has this prereleaser.before configuration in setup.cfg as suggested by @mauritsvanrees:

https://github.com/zopefoundation/zope.app.locales/blob/ab22edb2a2802b839c9707729d2dcf8691cc94e9/setup.cfg#L6-L8

mauritsvanrees commented 1 year ago

Upgrade to 7.0.1

There is no such release. 7.0.0 is the last one, both here and on PyPI.

The error happened when releasing zope.app.locales which has this prereleaser.before configuration in setup.cfg

I tried it and confirm it. With those lines, both fullrelease --no-input and prerelease --no-input fail. release --no-input works though. Initial suspicion: at the moment when this hook is loaded, the command line arguments are not parsed yet.

mauritsvanrees commented 1 year ago

I found it. The error only seems to be thrown by zest.releaser. In reality the error comes from zest.pocompile which has its own command line arguments to parse:

$ pocompile --no-input
Usage: pocompile [options] <directories>

pocompile: error: no such option: --no-input

So my idea of calling zest.pocompile.compile.main in the hook was not good after all. I will try one of my other suggestions. Meanwhile I close this bug.

mauritsvanrees commented 1 year ago

@icemac Try a fresh zest.pocompile 1.6.0 and use this in setup.cfg of zope.app.locales:

prereleaser.before = zest.pocompile.available
icemac commented 1 year ago

@mauritsvanrees Thank you for providing a fix. I updated zope.app.locales in https://github.com/zopefoundation/zope.app.locales/pull/19. It prevents the release when using zest.pocompile==1.5.0. So I believe it will work using the new version. (I do not want to cut a new release just now, so I'll not try it.)

mauritsvanrees commented 1 year ago

I suppose you could disable your internet connection and try it. :-)

icemac commented 1 year ago

@mauritsvanrees It works. Thank you!