Skip to content

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

Open
raajheshkannaa wants to merge 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/docker-version-display
Open

fix: resolve --version returning unknown in Docker#505
raajheshkannaa wants to merge 1 commit intoRhinoSecurityLabs:masterfrom
raajheshkannaa:fix/docker-version-display

Conversation

@raajheshkannaa
Copy link

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.

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"

1 participant