python-project-template
python-project-template copied to clipboard
Github actions PYPI_API_TOKEN not working for me
Describe the bug Hello Thanks for your awesome template! Everything from your template is working fine,. I have only two problems: one with writing VERSION number on MACOSX (see other issue) and one with github workflows for the release. Maybe I do it wrong. GitHub actions crashes at the end of the release.yaml.
Uploading checkatlas-0.0.8-py3-none-any.whl
25l
0%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━0.0/36.5 kB • --:-- • ?
0%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━0.0/36.5 kB • --:-- • ?
100%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━36.5/36.5 kB • 00:00 • 32.1 MB/s
100%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━36.5/36.5 kB • 00:00 • 32.1 MB/s
25hINFO Response from https://upload.pypi.org/legacy/:
403 Invalid or non-existent authentication information. See
[ https://pypi.org/help/#inv](https://pypi.org/help/#invalid-auth)alid-auth for more information.
INFO <html>
<head>
<title>403 Invalid or non-existent authentication information. See
[ https://pypi.org/help/#inv](https://pypi.org/help/#invalid-auth)alid-auth for more information.</titl
</head>
<body>
<h1>403 Invalid or non-existent authentication information. See
[ https://pypi.org/help/#inv](https://pypi.org/help/#invalid-auth)alid-auth for more information.</h1>
Access was denied to this resource.<br/><br/>
Invalid or non-existent authentication information. See
[ https://pypi.org/help/#inv](https://pypi.org/help/#invalid-auth)alid-auth for more information.
</body>
</html>
ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
Invalid or non-existent authentication information. See
[ https://pypi.org/help/#inv](https://pypi.org/help/#invalid-auth)alid-auth for more information.
This is with no doubt an error because it cannot connect to PyPi. If I run it manually with my PyPi account, everything works fine.
python setup.py sdist bdist_wheel
twine upload --verbose dist/*
I created a github secrets from PyPi and add it in GitHub. I did not touch the end of release.yaml
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload --verbose dist/*
Am I supposed to modify the token variable ? Thanks !
@drbecavin is your variable called PYPI_API_TOKEN
on github secrets?
Yes! Now it is in the environments secrets. But I tried in the repository secrets and it did not work.

Maybe it is relevant to say that my repository is not hosted on my personal github account , but on my organization account. https://github.com/becavin-lab/checkatlas
@drbecavin Your variable is called PIPY_API_TOKEN
, not PYPI_API_TOKEN
. This is understandable, as the guide in the README is currently incorrect:
If you want [codecov](https://about.codecov.io/sign-up/) Reports and Automatic Release to [PyPI](https://pypi.org/)
On the new repository settings->secrets add your PIPY_API_TOKEN and CODECOV_TOKEN (get the tokens on respective websites)
@rochacbruno FYI
Ah !!! Thanks. I changed the name of my secret on github for PYPI_API_TOKEN. But it won't work...
Does it change something that the secret s defne in environment, repository, or organization secrets ?
Thanks @AWConant we need to fix that, maybe that action changed and now required different set of keys, we need to also test that release action.
I have the same problem with the python_publish.yml workflow