title: Twine is asking for my password each time : how to use the .pypirc
body: <p>I have <code>pip</code> installed <code>pypirc</code> and set up a <code>~/.pypirc</code> file with the requisite password.  Why is <code>twine</code> asking for a password each time <code>python setup.py</code> is invoked?</p>
  
  <pre><code>  $twine upload --repository-url https://test.pypi.org/legacy/ dist/*
    Enter your username:
  </code></pre>
  
  <p>Here is the form of the <code>.pypirc</code></p>
  
  <pre><code>[distutils] # this tells distutils what package indexes you can push to
  index-servers =
    pypi
    pypitest
  
  [pypi]
  repository: https://pypi.python.org/pypi
  username: myuser 
  password: mypwd 
  
  [pypitest]
  repository: https://testpypi.python.org/pypi
  username: myuser 
  password: mypwd 
  </code></pre>
  
  <p><strong>Update</strong> Not including the <code>--repository-url</code> gives: </p>
  
  <pre><code>UploadToDeprecatedPyPIDetected: You're trying to upload to the legacy PyPI site 'https://pypi.python.org/pypi'. Uploading to those sites is deprecated.
   The new sites are pypi.org and test.pypi.org. Try using https://upload.pypi.org/legacy/ (or https://test.pypi.org/legacy/) to upload your packages instead. These are the default URLs for Twine now.
   More at https://packaging.python.org/guides/migrating-to-pypi-org/ .
  </code></pre>