COSIMA / regional-mom6

Automatic generation of regional configurations of the Modular Ocean Model 6 (MOM6) in Python
https://regional-mom6.readthedocs.io/en/latest
MIT License
24 stars 13 forks source link

Proper/better way to tag new releases? #110

Closed navidcy closed 6 months ago

navidcy commented 8 months ago

I'm wondering what's the proper way to automate the procedure of tagging a new release? I know how to do this for a Julia package but not with a python package.

I'm asking whether there is a way that with a simple action we get, e.g., the following:

At the moment, tagged versions of the package don't have their own doc version -- only the docs of the "latest" is available; see screenshot below

Screenshot 2024-02-22 at 13 32 56

cc @angus-g

aekiss commented 8 months ago

FYI @aidanheerdegen's model release team at NRI are setting up CI test-based automated tagging, with the major version updated only if test results change, otherwise minor version is updated

aidanheerdegen commented 8 months ago

Thanks for the shoutout @aekiss but I think what @navidcy is asking about is the machinery to get this working seamlessly.

If you want an example @dougiesquire recently update the payu publishing machinery using pyproject.toml and versioneer.

https://github.com/payu-org/payu/pull/403

It also publishes to conda and pypi.

navidcy commented 8 months ago

Yeap, I was thinking more something like in the spirit of what @aidanheerdegen points out! Thanks!

navidcy commented 7 months ago

OK, I see now that the packages was merged in conda-forge.

But at https://anaconda.org/conda-forge/regional-mom6 I see that it show up version 0.2.1 while currently we have 0.4.0.

Can we automate the way we release a new version so that we don't have to modify the version numbers in 43 places? Could someone help us do that?

cc @dougiesquire

navidcy commented 7 months ago

Would a GitHub action, e.g., like https://github.com/xgcm/xgcm/blob/master/.github/workflows/pythonpublish.yaml streamline the procedure?

dougiesquire commented 7 months ago

@navidcy there is a bot (regro-cf-autotick-bot) that should automatically create PRs for version updates when the PyPI distribution is updated - see here for details. Version 0.2.1 is the latest version on PyPI, which is why conda-forge is the same.

So the process for updating should usually involve only two steps:

If it's helpful, I can set up a github workflow to automatically upload new releases to PyPI?

navidcy commented 7 months ago

Yes please, @dougiesquire that would be great help!

navidcy commented 7 months ago

Hm... I went through the resources you pointed out @dougiesquire and couldn't find an example of a GitHub action.

But after some PRs are merged, I'm gonna tag a new release v0.5.0. How do I update the pypi (and by consequence the conda-forge) when the new release is tagged? I'm just asking how to do it manually, and we'll let the automation and GitHub action for later. (I'd like @dsroberts to install the v0.5.0 in the conda-analysis 24.01 environment on NCI, that's why I'm asking.)

angus-g commented 7 months ago

The pypi package is under my account, so I can do that manually once the tag is up, and then we can bump the conda version (which should be easier now that we have maintenance over it, I think?)

dougiesquire commented 7 months ago

and then we can bump the conda version (which should be easier now that we have maintenance over it, I think?)

Yup, a PR should be opened automatically in the feedstock repo

navidcy commented 7 months ago

Great! I'll ping you @angus-g when I tag the new release. Thanks both!

navidcy commented 7 months ago

@angus-g can you push v0.5.0 to pypi?

navidcy commented 7 months ago

@angus-g can you add me as maintener on pypi? I just made an account; username navidcy

navidcy commented 7 months ago

@dougiesquire pypi v0.5.0 but I don't see any automatic PR generated. Am I looking at the right spot?

navidcy commented 7 months ago

oh... is it here that the PR will appear? https://github.com/conda-forge/regional-mom6-feedstock/pulls

will the PR be opened automatically even if regro-cf-autotick-bot is not set up?

angus-g commented 7 months ago

oh... is it here that the PR will appear? https://github.com/conda-forge/regional-mom6-feedstock/pulls

Yes. I don't have a sense for how long the bot takes to get around to the updates, could just take a moment...

navidcy commented 7 months ago

OK, I'll give it a day or so :)

navidcy commented 7 months ago

If it's helpful, I can set up a github workflow to automatically upload new releases to PyPI?

@dougiesquire I'll leave this on you, right? It will be very helpful! now both me and @angus-g are maintainers in the pypi entry of this package (I don't know if that's a useful piece of info for the GitHub action)