Skip to content

fix: resolve --version returning unknown in Docker#505

Merged
nobodynate merged 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/docker-version-display
Mar 20, 2026
Merged

fix: resolve --version returning unknown in Docker#505
nobodynate merged 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/docker-version-display

Conversation

@raajheshkannaa
Copy link
Copy Markdown
Contributor

Closes #486

get_pacu_version() reads pyproject.toml by walking up from pacu/main.py.
After pip install . (as the Dockerfile does), the code runs from site-packages
where pyproject.toml doesn't exist, so it falls back to "unknown".

Fix: use importlib.metadata.version() (stdlib since Python 3.8) as the primary
source. This reads from installed package metadata, which pip install populates
correctly. The pyproject.toml fallback stays for development installs.

Copy link
Copy Markdown
Contributor

@nobodynate nobodynate left a comment

Choose a reason for hiding this comment

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

Looks good and fixes the issue

@nobodynate nobodynate merged commit df74533 into RhinoSecurityLabs:master Mar 20, 2026
2 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.

Docker image --version returns "Pacu unknown"

2 participants