-
Notifications
You must be signed in to change notification settings - Fork 14
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
Automatic release on Pypi #18
Comments
Thanks a lot for your help Mathieu and the detailed instruction! I decided to have the automatic publish on release and it is now working. We still need to update the README as the install description is outdated. |
I also see that it did not get the version right and released it as 0.3.0 instead of the new 0.4.0 that I created. |
Great, looks like it's working. Just one bullet point that I forgot: you do need to increment the version in the Line 7 in 5659d81
There are tools to automate that part, like versioneer, but I am not so familiar with them. Anyway, the release 0.4.0 on GitHub was released as 0.3.0 on Pypi. The |
Exactly, with this workflow, the version increment is not automated. I should have mentioned it, sorry. Thus. the workflow for a release is:
Example: Current main branch is on 0.5.0.dev.
|
Thanks, all should be fixed now.
|
At first, the food-based terminology is very weird, but you get used to it ;) To release on the Once the 'recipe' is ready to be merged in the https://github.com/conda-forge/staged-recipes repository, you need to open a PR and let the CI do their magic. Once everything is green, a Then, you wait. Until in the next couple of hours, the
As an example, here is a feedstock and the webpage. Everything is automated, and for a pure python package like this one, it's very low maintenance as a bot (that I will enable on the feedstock) will monitor the Pypi release and automatically update the feedstock if a new release appears on Pypi. |
Also, I did list both you and myself as maintainers of the feedstock. This is only for feedstock maintenance, meaning I will help to keep the One thing to know is that if you release on |
Do you know if all dependencies are available for LaPy? |
They are, even |
It took a long time to get the PR accepted in And I added the And finally, you should have received this kind of message from the Hi! This is the friendly automated conda-forge-webservice. I updated the Github team because of this commit.
You should get push access to this feedstock and CI services. Your package won't be available for installation locally until it is built Feel free to join the community chat room. NOTE: Please make sure to not push to the repository directly. I hope this release on PyPI and |
Thanks @mscheltienne for your help! We are currently updating doc-strings and would then try to create automated documentation. |
Nice, feel free to ping me on an issue/PR when you are done updating the docstrings to the numpy convention and if you want help with the documentation build. I will gladly provide you with a hands-on doc build and deployment workflow. |
Ping :-) We are done with the docstrings for now. |
Now that the packaging is taken care of in #16 (and #17 for the typo in the line-length..), here are the steps to enable automatic releases on Pypi. Luckily, the name seems to be available: https://pypi.org/search/?q=lapy
All done. The publication workflow is now able to build the package and upload it to Pypi:
LaPy/.github/workflows/publish.yml
Lines 25 to 31 in 2b7a7f4
After the first upload, you can go back to the settings on Pypi, create a new token with a scope restricted to
LaPy
, delete the token with full scope and replace the value of the PYPI_API_TOKEN variable on GitHub for additional safety.When does this workflow trigger? The triggers are defined at the top:
LaPy/.github/workflows/publish.yml
Lines 2 to 5 in 2b7a7f4
workflow_dispatch:
is a manual trigger. You can go to the 'Actions' tab of the repository click on a workflow on the left, and if it has this trigger, you will see 'Run workflow' on the right-side of the screen.is an automatic trigger on release (at the moment, commented out), i.e. on the repository page, if you click on 'Releases' in the right-pane, then on 'Draft a new release' and publish a new release, it will automatically build and upload the repository to Pypi.
Note that the target has to be set to the branch to build and upload (and that branch must have the workflow). This is useful because usually you keep 'maintenance branches' of older release, which enable you to cherry-pick bugfixes from your active development branch and cut a new bugfix release with those fixes implemented before releasing the new minor (or major) version of your package, with the same bugfixes and many more improvements and features.
Final point, if you want to give it a shot with nothing being definitive, you can use Test PyPI instead (https://test.pypi.org/).
Final final point, once the Pypi release is done, we can create the recipe and feedstock for
conda-forge
which will automatically release onconda
based on the release on Pypi.I hope this was the right amount of detail, as I don't know what your knowledge is about distribution channels. Please let me know if that was too much detail and if I should shorten the explanation, or if on the contrary you still have questions.
Mathieu
The text was updated successfully, but these errors were encountered: