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

Autodeploy to PyPI #422

Closed
hugovk opened this issue Nov 23, 2020 · 16 comments · Fixed by #428
Closed

Autodeploy to PyPI #422

hugovk opened this issue Nov 23, 2020 · 16 comments · Fixed by #428

Comments

@hugovk
Copy link
Member

hugovk commented Nov 23, 2020

As suggested in #356, I'll set up automated deploys:

  • Deploy to TestPyPI on merge to master, to make sure the release mechanism is working smoothly and avoid surprises on release day
  • Deploy to production PyPI for GitHub releases/tags

I've set up a test twitter project on TestPyPI.

@RouxRC If you create an account on https://test.pypi.org, I'll give you access too.

Then, to use https://github.com/pypa/gh-action-pypi-publish, we then need to create API tokens for TestPyPI and PyPI and store them as secrets under https://github.com/sixohsix/twitter/settings.

TODO:

  1. Add an API token called (say) twitter-ci at https://test.pypi.org/manage/account/token/
  2. Paste the token as TEST_PYPI_PASSWORD at https://github.com/sixohsix/twitter/settings/secrets/actions/new
  3. Repeat for production PyPI https://pypi.org/manage/account/token/, save as PYPI_PASSWORD

More info on PyPI API tokens: https://pypi.org/help/#apitoken

I don't have access to https://github.com/sixohsix/twitter/settings. @RouxRC Please could you either give me access to that, or please could you follow the instructions above to add the tokens?

@RouxRC
Copy link
Member

RouxRC commented Nov 24, 2020

Great!
I created a boogheta account on Pypi test as well.
But I don't have access to the repo settings on Github yet actually, I guess there is still one last "small" thing we shall ask @sixohsix, which is admin rights to the repo, pretty please :)

@hugovk
Copy link
Member Author

hugovk commented Nov 24, 2020

✅ Invited boogheta to TestPyPI

@polm
Copy link
Contributor

polm commented Jan 9, 2021

I realize this is kind of an old issue, but as a note, you can't grant access to settings to other people on a user-owned repository. From the Github help:

To create secrets for an environment in a user account repository, you must be the repository owner. To create secrets for an environment in an organization repository, you must have admin access.

This has bitten me on a repo I inherited. What I did as a workaround is do the PyPI uploads from a personal fork.

@hugovk
Copy link
Member Author

hugovk commented Jan 9, 2021

Aha, good to know, thanks!

Creating a dedicated organisation for the repo was suggested in #356, shall go ahead with that?

If so, the next challenge is naming things!

Already taken:

  • https://github.com/twitter
  • https://github.com/python-twitter
  • https://github.com/ptt

Not taken:

  • https://github.com/python-twitter-tools
  • https://github.com/twitter-python
  • https://github.com/ptt-dev
  • https://github.com/python-twitter-dev
  • https://github.com/twitter-tools
  • ?

@RouxRC
Copy link
Member

RouxRC commented Feb 7, 2021

Hey @hugovk! Apologies for my late answer!
It's not an easy choice to make, I guess since it's the original name of the project python-twitter-tools might be the best choice, although to better match the fact the pypi project is named twitter, maybe just twitter-python would be better, also considering the CLI tools parts of the project are not actually really maintained contrary to the python lib part.
So I would be in favor of those two, with a small preference for the second. What's your opinion?
Also, I'm taking the opportunity while answering this to ping again @sixohsix: we won't bother you anymore afterwards I think, but that would be really useful if you could take a few minutes one last time to just set @hukovk and myself admins of the repo so that we would be able to do all leftovers migrations operations. Thanks a lot in advance!
BTW: I'm finally jumping back on the train and started adding code in the repo to handle the new v2 API from Twitter, so being able to publish new releases will quickly be handy ;)

@hugovk
Copy link
Member Author

hugovk commented Feb 10, 2021

Both fine by me, although python-twitter-tools might be better than twitter-python, so there's no confusion between:

https://github.com/twitter-python/twitter
https://github.com/python-twitter/twitter (an abandoned demo script)

@RouxRC
Copy link
Member

RouxRC commented Feb 19, 2021

All right, since it's for the organization name anyway, I guess keeping the original library name makes the most sense.
I let you go forward and create the organization @hugovk?
I will try and e-mail Mike for the settings access since I feel like he's not reading these anymore at all :)

@hugovk
Copy link
Member Author

hugovk commented Feb 21, 2021

@RouxRC I've created the https://github.com/python-twitter-tools org and invited you and Mike.

@RouxRC
Copy link
Member

RouxRC commented Feb 21, 2021

Thanks!

@sixohsix
Copy link
Collaborator

I transferred ownership of the repo to the organization. Please let me know if there is more I should do to enable your work.

@hugovk
Copy link
Member Author

hugovk commented Mar 2, 2021

Thank you! I've made you both owners of the org as well, and added the PyPI API tokens to https://github.com/python-twitter-tools/twitter/settings/secrets/actions

I'll get the rest of the autodeploy set up later.

@RouxRC
Copy link
Member

RouxRC commented Mar 2, 2021

Lots of thanks @sixohsix & @hugovk!

@RouxRC
Copy link
Member

RouxRC commented May 31, 2021

Hey Hugo, seems like some authentication to PyPi is still missing: https://github.com/python-twitter-tools/twitter/runs/2711860451?check_suite_focus=true
Any idea what misses?

@RouxRC
Copy link
Member

RouxRC commented May 31, 2021

Found it, the token was missing, I recreated it and set it in the repo settings and it works now!
Will try to make a new release now!

@RouxRC
Copy link
Member

RouxRC commented May 31, 2021

And it worked, version 1.19 with all changes from the past 2 years finally shipped! Thanks again @hugovk and @sixohsix, the process will be so much easier now!

@hugovk
Copy link
Member Author

hugovk commented May 31, 2021

Great, thank you for releasing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants