Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

htgoebel
Copy link
Contributor

See #238 (comment):

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 pypa/twine#194 (comment)), one of which twine.cli.dispatch() could be. This would allow something like:

dispatch(twine_command, '-r', server, *files_in_dist)

@htgoebel
Copy link
Contributor Author

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.

Move a few lines down to where they are related to.
Use twine.cli.dispatch(), passing it command-line arguments. The error
handling needed to be changed, too, since twine does not return an
result code, but raises an error in failure.

Even if twine does not offer a stable API the command-line interface
should be acceptable stable, thus talking to twine at (nearly)
command-line level should be okay. If twine.cli.dispatch() vanishes
or changes, an acceptable supplement should be easy to find.
@htgoebel
Copy link
Contributor Author

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.

@htgoebel htgoebel closed this Jan 22, 2019
@htgoebel htgoebel reopened this Jan 22, 2019
@reinout
Copy link
Collaborator

reinout commented Jan 23, 2019

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.

@reinout reinout changed the title Use twine.cli.dispatch() to run wine Use twine.cli.dispatch() to run twine Jan 23, 2019
@htgoebel htgoebel closed this Apr 3, 2019
@htgoebel htgoebel deleted the twine-high-level branch April 3, 2019 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants