-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add workflow to publish on PyPI #70
Conversation
Seems sensible. Maybe worth cross-checking against this guide? And with TestPyPI, I think we should use that initially (just run |
I agree that for automatic deployment using TestPyPI is redundant. However, it was there, in the past, so you could check that the uploaded package was working as planned when downloading it. We found issues in SWMManywhere where some files hadn't been bundleded with the wheel, for example. Ideally, what you want to do is to publish pre-reseases to TestPyPI, check that all works, and then publish the full release to PyPI. |
ad2a275
to
c9dc3e7
Compare
That's a good resource. I've had a look through and it seems we're ticking all the boxes.
You mean just locally, rather than having it as part of the workflow? |
Makes sense. I guess you could maybe achieve the same thing by trying to use the wheel before uploading? |
I think this is good to go, as long as @AdrianDAlessandro is happy with it. Now that #76 is merged, this is the last piece before you can push to PyPI 🎉 |
(Ok there are a couple more issues that probably should be done first, but you could publish after this 😛) |
Yes |
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 think I'm happy with this. But I have one extra thought! Is there a way to confirm that the version number used in the release tag matches the version number in the pyproject.toml?
I don't think so 😞. It doesn't look like the GitHub Action we're using will check anything like that -- it just consumes whatever wheel files you give it. I suppose we could script that check fairly easily though... It is a potential footgun, after all. I'm happy to have a go, if we think it will be useful. |
Not with poetry. To have that done right we will need to use hatch. See the setup in |
That's useful. |
Yea, I think it's useful. Maybe we put an extra job before |
@AdrianDAlessandro Cool. I've had a go. I tried testing it locally as much as I could and I think it should work. |
I also fixed a stray typo |
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.
Nice! This looks good to me!
Cool. Thanks! |
I've added a CI workflow to auto-publish Autocorpus to PyPI on release, based on the one we use for MUSE. (I simplified it a bit though as there are some steps we don't need and I figure there's not a lot of point in trying to publish to testpypi beforehand -- either it will succeed publishing to actual PyPI or not, so I don't see what that gains us). I'm tagging @dalonsoa as I think he wrote this workflow originally.
The repo is currently not in a state where it could be published as a wheel (see #32), but we won't be making a release before this is sorted, so I think this can be reviewed now. I'll make it a draft PR anyway.
Aside from that, someone in the research team will need to set up an account on PyPI and enable trusted publishing (if you do this, you don't need API tokens or passwords).
Closes #33.