Skip to content

add package build and upload to pypi for releases into ci/cd setup#71

Merged
observingClouds merged 7 commits intomllam:mainfrom
leifdenby:feat/deploy-package-to-pypi
Jun 10, 2025
Merged

add package build and upload to pypi for releases into ci/cd setup#71
observingClouds merged 7 commits intomllam:mainfrom
leifdenby:feat/deploy-package-to-pypi

Conversation

@leifdenby
Copy link
Copy Markdown
Member

@leifdenby leifdenby commented Aug 20, 2024

Describe your changes

Add ci/cd setup to build and upload releases created on github automatically to pypi.org

This would allow people to install releases of neural_lam directly with pip from pypi.org, i.e. to install releases of neural_lam with:

python -m pip install neural_lam

I could also include a note in the README about being able to install releases of neural-lam from pypi, but I haven't yet.

The change requires a pypi.org API key be added to the repository secrets (you can see its use here: https://github.com/mllam/neural-lam/pull/71/files#diff-8edc26411310cfa4356b22a2f31845a08e57cb9f418b3b802f0366a2630af992R22). I have create an API token under my pypi.org user, but I will transfer this to a group on pypi.org when the first package has been uploaded, and people can then join that group on pypi.org.

Issue Link

There is no issue to link to. We haven't discussed this before I don't think. But I thought it might make sense and be convenient since with #37 and #32 it is now possible to install neural-lam as a package.

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the README to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging)

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • author has added an entry to the changelog (and designated the change as added, changed or fixed)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@leifdenby
Copy link
Copy Markdown
Member Author

This is just a suggestion btw. We don't have to include this in release v0.2.0, I just thought it might be nice since we have everything in place now to make it possible :)

@leifdenby leifdenby changed the title add package build and upload to pypi in cicd add package build and upload to pypi for releases into ci/cd setup Aug 20, 2024
@joeloskarsson
Copy link
Copy Markdown
Collaborator

I think this is great, and I agree that we should put neural-lam on pypi.

Perhaps it would make most sense to do this for the v0.3.0 release? The logic being that at the moment there are still things that are MEPS (region/data) specific, which does not really make sense in a general package that you install from pypi. In that way it is better to make sure all users end up in this repo and read about these limitations before installing.

I see v0.3.0 as the step to a completely general setup, and then it makes sense to put up the package with it.

@leifdenby leifdenby added this to the v0.3.0 milestone Aug 23, 2024
@joeloskarsson joeloskarsson removed this from the v0.3.0 milestone Nov 20, 2024
@leifdenby leifdenby added this to the v0.4.0 milestone Feb 12, 2025
Copy link
Copy Markdown
Contributor

@observingClouds observingClouds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments and yes, it would be great to add the pypi installation instructions to the README as this would be the preferred way by a lot of users.

Comment thread .github/workflows/ci-pypi-deploy.yml Outdated
Comment thread .github/workflows/ci-pypi-deploy.yml
@joeloskarsson
Copy link
Copy Markdown
Collaborator

As this is the only PR left for v0.4.0, it would be nice to either complete this or push it to a later version. @observingClouds, are you interesting in taking this up while Leif is away? Or should I push it to later?

This looks mostly finished, but I don't know the ci/cd things good enough to say for sure. So would be happy if someone with more experience wanted to weigh in and let me know if this is good to go.

@observingClouds
Copy link
Copy Markdown
Contributor

@joeloskarsson I completed the PR now. Once #140 is merged, the tests should pass and can be merged for v0.4.0

@observingClouds observingClouds self-assigned this Jun 6, 2025
@joeloskarsson
Copy link
Copy Markdown
Collaborator

Awesome! 😄 Then once the tests are working again we should be able to just merge all the last things and prepare the v0.4.0 release. Then we can immediately try this out.

@observingClouds observingClouds merged commit 876f210 into mllam:main Jun 10, 2025
9 checks passed
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 this pull request may close these issues.

3 participants