Skip to content

Conversation

@CodeVishal-17
Copy link
Contributor

Pull Request

Description

This PR fixes an issue where Docker builds always reported the application
version as 0.0.0, even when git tags were present.

What changed

  • Added setuptools-git-versioning to build-system.requires so the plugin
    is available at build time.
  • Ensured git metadata is available during the Docker build stage.
  • Confirmed the runtime reads the version from package metadata instead of
    relying on git at runtime.

Why

Without setuptools-git-versioning installed at build time, setuptools
silently fell back to 0.0.0. This caused incorrect version logging in
production Docker images.

With this change, Docker images correctly reflect the git tag version
(e.g. 1.4.14) in logs.

Fixes #126

How Has This Been Tested?

  • Built the Docker image locally using docker build --no-cache.

  • Ran the container and verified the startup logs report the correct version.

  • Verified runtime version directly using:
    python -c "from solar_consumer import __version__; print(__version__)"

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have checked my code and corrected any misspellings

@peterdudfield peterdudfield merged commit 720a250 into openclimatefix:main Jan 6, 2026
4 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.

bug: version not showing up in docker

2 participants