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

Use twine.cli.dispatch() to run twine #284

Closed htgoebel closed 5 years ago

htgoebel commented 6 years ago

See https://github.com/zestsoftware/zest.releaser/issues/238#issuecomment-353128610:

I tried this and found myself re-implementing quite some parts of twine.commands.upload#upload(). Not only one would need to filter out the .asc files first, but also add_gpg_signature to each file to be uploaded, if the signature exists. Although this would still be only a view lines, keeping up with twine features and PyPI API changes would become a cat-and-mice-game in he long run.

I asked for another high-level api (see https://github.com/pypa/twine/issues/194#issuecomment-353126091), one of which twine.cli.dispatch() could be. This would allow something like:

dispatch(twine_command, '-r', server, *files_in_dist)
htgoebel commented 6 years ago

I know this code has conflict, but I wanted to have a pull-request to refer to in the pypa/twine pull/361 for the case I'm deleting my fork.

htgoebel commented 5 years ago

I just rebased on current master and resolved the conflicts.

The discussion about an API for twine did not show any results and what is discussed there is much too detailed. Thus I suggest to not wait for twine providing some documented API, but use this high-level function call.

Please note: The CI-tests for Python 2.7 fail when trying to install git-svn, see#307. Otehr tests fail with a stale build.

reinout commented 5 years ago

Let's hope that twine doesn't remove/hide the perfectly fine cli "api". I just totally don't get why twine seems to dislike its own defaults. If you use it from the outside, the defaults should be banned and you should do all sorts of config work, replicating what twine itself already does.

A well, we can always just call it on the command line.... That's what we did with setup.py upload.