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

Consider adding a twine accounts command group #324

Closed
theacodes opened this issue Mar 18, 2018 · 5 comments
Closed

Consider adding a twine accounts command group #324

theacodes opened this issue Mar 18, 2018 · 5 comments

Comments

@theacodes
Copy link
Member

In light of Keyring documentation (#323) it occurs to me that an ideal user experience never asks the user to deal with the keyring directly. Twine should just handle it.

I propose the following additions to twine's interface:

twine accounts add

Adds a username and password to the keyring for uploading to PyPI.

$ twine accounts add
pypi.org username: username
password for {username}: ...
Added account {username} for pypi (https://upload.pypi.org/legacy).

Adding for test PyPI should just require the --test flag:

$ twine accounts add --test
test.pypi.org username: username
password for {username}: ...
Added account {username} for testpypi (https://test.pypi.org/legacy).

Adding for custom indexes should use the repository-url argument like upload:

$ twine accounts add --repository-url=https://my-index.com
my-index.com username: username
password for {username}: ...
Added account {username} added for https://my-index.com.

twine accounts delete

Deletes a specific account for a given index.

For PyPI usernames:

$ twine accounts delete username
Deleted account {username} for pypi (https://upload.pypi.org/legacy).

And the same add add for testpypi and custom indexes.

twine accounts list

This should list all accounts in the keyring and their respective indexes;

$ twine accounts list
* username on https://upload.pypi.org/legacy
* username2  on https://upload.pypi.org/legacy
* testusername on https://test.pypi.org/legacy
* customusername on https://my-index.com
@sigmavirus24
Copy link
Member

--test seems odd to me. I wonder if we should encourage naming their accounts, e.g.,

twine accounts add production --repository-url=https://pypi.org --username=username
password for {username}: ...

twine accounts add test --repository-url=https://test.pypi.org

twine accounts add work --repository-url=https://pypi.initrode.corp

@theacodes
Copy link
Member Author

I was trying to get to the minimal interface that wouldn't require changes to any other twine commands. Naming accounts would mean that twine upload would need to change to work with accounts instead of index URLs.

@sigmavirus24
Copy link
Member

Naming accounts would mean that twine upload would need to change to work with accounts instead of index URLs.

Really? We couldn't just use the repository URL to index the accounts ... like we do today? .pypirc already has a way of managing accounts as it is.

@crwilcox
Copy link

crwilcox commented May 7, 2019

I understand why labeling a endpoint/username pair with a short/descriptive name would be helpful. That said, because keyring uses endpoint/username pairs to lookup credentials, I don't know where the name of the account would exist. It seems that would require Twine to track that metadata.

This seems to have started though from adding a --test flag. There is discussion about turning down test in favor of staging on pypi.org so perhaps moving that out of the initial design, instead requiring a specific URL would make sense?

@bhrutledge
Copy link
Contributor

Closing this in favor of #216, but I think there are good ideas worth referencing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants