Skip to content

show version from pyproject.toml file and show in in footer , the gi… - #27

Open
farshad68 wants to merge 7 commits into
developfrom
develop-showversion
Open

show version from pyproject.toml file and show in in footer , the gi…#27
farshad68 wants to merge 7 commits into
developfrom
develop-showversion

Conversation

@farshad68

Copy link
Copy Markdown
Member

…t hash is also available and show as tooltip

@farshad68
farshad68 requested a review from denkv April 14, 2026 09:21
Comment thread learn2rag/ui/__init__.py

def get_version() -> str:
try:
with open("pyproject.toml", "rb") as f:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this work with a packaged version?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

from importlib.metadata import version, PackageNotFoundError
try:
    return version('learn2rag')
except PackageNotFoundError:
    return 'unknown'

@denkv denkv self-assigned this Aug 26, 2026
Comment thread learn2rag/ui/__init__.py

def get_git_hash() -> str:
try:
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

text=True subprocess option instead of decode()

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.

2 participants