-
Notifications
You must be signed in to change notification settings - Fork 367
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
[MRG] Travis: Deploy releases to pypi #301
Conversation
Looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like having build stages, +100 for using them!
I'd like to see that the nightly build is allowed to fail, and that it is put last to make everything else complete faster as a final job that is allowed to fail doesn't need to finish for the travis build as a whole can report success. See for example https://docs.travis-ci.com/user/customizing-the-build/#allow_failures-examples for a not obvious example, and combine that with the fast_finish thing I documented in the z2jh .travis.yml: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/04f8a1e1546dc79a4fecc13b62bb4fc15c2992ba/.travis.yml#L68-L72
@consideRatio How does this look? |
@manics this LGTM! Is the token stuff setup? |
@consideRatio No! Someone with access tothe PyPi project needs to add the token either in the Travis web ui or by adding a secret to |
@manics i was a maintainer but not an owner so I cannot create such token. What path do you recommend to take regarding adding it to the web ui of travis or adding it as a encrypted secret in .travis.yml ? @choldgraf or @minrk can perhaps help out with permissions |
@consideRatio you are now an owner! |
@consideRatio Either add in Travis web UI: Or use an encrypted secret inside `.travis.yml There's an ongoing discussion on jupyterhub/team-compass#213 (comment) about pypi accounts and token scopes, but if you're ready to release might as well use your own token and update later? |
Important insights:
Anyhow, we now have a PYPI_PASSWORD setup, which is making the variable accessible on all pushes to the git repo. It is tied to a deployment token specifically for jupyterhub/oauthenticator. Note that I opted for PYPI_PASSWORD over PYPI_TOKEN as this documentation suggest that: https://docs.travis-ci.com/user/deployment-v2/providers/pypi. You can therefore remove the password: $PYPI_TOKEN fields and instead document that the PYPI_PASSWORD will be set indirectly by the PYPI_PASSWORD environment variable. It sais that the default distribution is sdist, perhaps it should be bdist_wheel or similar also? I'm super noob about these matters really but I think it is very relevant that we inspect the varioable options for PyPI deployment here: https://docs.travis-ci.com/user/deployment-v2/providers/pypi#known-options |
@consideRatio Done! |
@manics ❤️ |
Release tagged builds to PyPi using Travis.
A matrix build will normally deploy multiple times. The usual way of deploying once is to use either
skip_existing: true
or a conditional that matches one of the jobs. The downside is that the deploy only depends on whether that particular job passes, other jobs in the matrix may fail.I think using build stages is better because the deploy only happens if all matrix jobs pass. It's also clearer in travis since the deploy runs as it's own job.
I've tested this on testpypi:
Next steps:
PYPI_TOKEN
to Travis or add an encrypted secret to travis.ymlRelated: