diff --git a/AUTHORS b/AUTHORS index 4ef01766..47c1ab30 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Jannis Leidel Ralf Schmitt Ian Cordasco Marc Abramowitz (http://marc-abramowitz.com/) +Tom Myers \ No newline at end of file diff --git a/README.rst b/README.rst index 454e7f8d..086b94df 100644 --- a/README.rst +++ b/README.rst @@ -94,6 +94,8 @@ Options The password to authenticate to the repository with -c COMMENT, --comment COMMENT The comment to include with the distribution file + --config-file FILE + The .pypirc config file to use Resources diff --git a/twine/commands/upload.py b/twine/commands/upload.py index 98ba6416..a7e57275 100644 --- a/twine/commands/upload.py +++ b/twine/commands/upload.py @@ -79,7 +79,7 @@ def sign_file(sign_with, filename, identity): def upload(dists, repository, sign, identity, username, password, comment, - sign_with): + sign_with, config_file): # Check that a nonsensical option wasn't given if not sign and identity: raise ValueError("sign must be given along with identity") @@ -90,9 +90,9 @@ def upload(dists, repository, sign, identity, username, password, comment, ) dists = [i for i in dists if not i.endswith(".asc")] - # Get our config from ~/.pypirc + # Get our config from the .pypirc file try: - config = get_config()[repository] + config = get_config(config_file)[repository] except KeyError: raise KeyError( "Missing '{0}' section from the configuration file".format( @@ -252,6 +252,11 @@ def main(args): "-c", "--comment", help="The comment to include with the distribution file", ) + parser.add_argument( + "--config-file", + default="~/.pypirc", + help="The .pypirc config file to use", + ) parser.add_argument( "dists", nargs="+",