Why am I getting Error 405 while uploading my package to https://test.pypi.org/legacy?
ant
ant at anthive.com
Sun Dec 23 14:57:56 EST 2018
sntshkmr60 at gmail.com wrote:
> I'm trying to upload my package to PyPi, but before that I wanted to upload my package to TestPyPi.
>
> I'm following https://packaging.python.org/guides/using-testpypi/
>
> I'm issuing this command: `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
>
> Here is the output:
>
> ```
> Enter your username: sntshkmr60
> Enter your password:
> Uploading distributions to https://test.pypi.org/
> Uploading mysecretpackage-0.0.1a0-py3-none-any.whl
> 100%|████████████████████████████████████████████████████████████████████████| 16.7k/16.7k [00:06<00:00, 2.50kB/s]
> NOTE: Try --verbose to see response content.
> HTTPError: 405 Client Error: Method Not Allowed for url: https://test.pypi.org/
> ```
>
> Here is the extra output from --verbose flag:
>
> ```
> Content received from server:
><html>
> <head>
> <title>405 Method Not Allowed</title>
> </head>
> <body>
> <h1>405 Method Not Allowed</h1>
> The method POST is not allowed for this resource. <br/><br/>
>
> </body>
></html>
> HTTPError: 405 Client Error: Method Not Allowed for url: https://test.pypi.org/
> ```
>
> What am I doing wrong?
well, i used it earlier so here is how i have it set up
as follows.
because this is testing repository i am not worried about
password being stored in a file:
.pypirc
=====
[distutils]
index-servers=
testpypi
[testpypi]
repository: https://test.pypi.org/legacy/
username: UserName
password: Password
=====
and my upload command is:
=====
#!/bin/sh
#
# upload ngfp to test pypi
NGFP_SRC_HOME="/home/me/src/salsa/ngfp"
if test ! -d "$NGFP_SRC_HOME" ; then
echo " directory $NGFP_SRC_HOME does not exist!"
exit
fi
cd $NGFP_SRC_HOME
twine upload --repository testpypi dist/*
=====
note: it may take a while for what you uploaded to be made
available for download again even if it reflected in your
project page. sometimes it has been as long as a half hour
or more before it comes down. other times it has only been
a few minutes.
hope this helps...
ant
More information about the Python-list
mailing list