Skip to content
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

Dynamic versioning #118

Merged
merged 6 commits into from
Feb 17, 2025
Merged

Conversation

observingClouds
Copy link
Contributor

@observingClouds observingClouds commented Feb 10, 2025

Describe your changes

This PR introduces dynamic versioning, meaning the version of neural-lam would no longer be hard-coded in the pyproject.toml but derived from the git hash or from the metadata in e.g. wheels published to pypi.

The advantage of this method is that development changes to the neural-lam code become immediately visible in downstream applications, e.g. mlflow server and make it easier to track those changes.

No new dependencies are introduced.

Issue Link

< Link to the relevant issue or task. > (e.g. closes #00 or solves #00)

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). This applies only if you have write access to the repo, otherwise feel free to tag a maintainer to add a reviewer and assignee.

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.

@observingClouds
Copy link
Contributor Author

I tested now also how this will affect installation from e.g. a downloaded release zip folder without any additional metadata or SCM connected. In this case the version cannot be derived and will now fallback to 0.0.0. But this should anyway only be an edgecase.

@observingClouds observingClouds marked this pull request as ready for review February 12, 2025 08:40
@leifdenby
Copy link
Member

bah, the tests are failing for pip + gpu testing on AWS. It looks like this is due to the instance running out of space. This didn't happen before. But probably we should change it so even with pip the venv is created on the mounted nvme drive, like is done when testing with pdm: https://github.com/observingClouds/neural-lam/blob/feat/dynamic_version/.github/workflows/install-and-test.yml#L60.

What do you think?

Copy link
Member

@leifdenby leifdenby left a comment

Choose a reason for hiding this comment

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

Looking good. Just one minor comment (and we should probably ensure the tests pass, but maybe I will need to do a separate PR for that)

@matschreiner
Copy link

I think this is great!
I haven't been versioning my stuff ever, so I don't have the most qualified opinion on this, but I definitely think that whatever can help reduce human error in the workflow is a great idea! :) And I think that as long as you can use pip without having to know about what pdm is doing in the background it is great

Copy link
Member

@leifdenby leifdenby left a comment

Choose a reason for hiding this comment

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

Good to go!

scratch that. Need to work the issues with the cicd setup first. I think I am on the right track with #126 but need to check with @khintz

@leifdenby
Copy link
Member

If you merge main into your branch the tests should pass now @observingClouds :)

@observingClouds observingClouds merged commit 465f404 into mllam:main Feb 17, 2025
8 checks passed
@observingClouds observingClouds deleted the feat/dynamic_version branch February 17, 2025 12:24
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