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

Github actions PYPI_API_TOKEN not working for me #21

Open
drbecavin opened this issue Jun 20, 2022 · 7 comments
Open

Github actions PYPI_API_TOKEN not working for me #21

drbecavin opened this issue Jun 20, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@drbecavin
Copy link

drbecavin commented Jun 20, 2022

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 drbecavin added bug Something isn't working help wanted Extra attention is needed labels Jun 20, 2022
@rochacbruno
Copy link
Owner

@drbecavin is your variable called PYPI_API_TOKEN on github secrets?

@drbecavin
Copy link
Author

Yes!
Now it is in the environments secrets. But I tried in the repository secrets and it did not work.

Capture d’écran 2022-06-20 à 21 58 53

@drbecavin
Copy link
Author

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

@emptierset
Copy link

@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

@drbecavin
Copy link
Author

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 ?

@rochacbruno
Copy link
Owner

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.

@esimorre
Copy link

I have the same problem with the python_publish.yml workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants