Skip to content

[Maintenance] Move DieLibrary git tag handling to a separate file and expose it to Python#39

Merged
calladoum-elastic merged 8 commits into
mainfrom
calladoum/use-separate-file-for-dielib-git-tag
Feb 19, 2026
Merged

[Maintenance] Move DieLibrary git tag handling to a separate file and expose it to Python#39
calladoum-elastic merged 8 commits into
mainfrom
calladoum/use-separate-file-for-dielib-git-tag

Conversation

@calladoum-elastic

@calladoum-elastic calladoum-elastic commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Refactor the handling of the DieLibrary git tag by moving it to a separate file and exposing it to the Python interface.
  • Enhance tests to validate the new tag exposure and improve type hints for better clarity.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the DieLibrary git tag management by extracting it into a dedicated .dielib_commit file and exposing the tag to the Python interface. The changes improve maintainability by centralizing version control and modernize the codebase with updated type hints using PEP 604 syntax.

Changes:

  • Created .dielib_commit file to store the DieLibrary git commit hash
  • Exposed dielib_tag to Python via C++ bindings and Python module exports
  • Modernized type hints from typing.Union/Optional to PEP 604 union operator (|) syntax
  • Enhanced load_database() to accept pathlib.Path in addition to strings
  • Added test coverage for the new dielib_tag attribute

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.dielib_commit New file containing the DieLibrary git commit hash for version management
cmake/FindDieLibrary.cmake Updated to read git tag from .dielib_commit file instead of hardcoding it
python/inc/die.hpp Added DIELIB_TAG preprocessor definition with empty string default
python/CMakeLists.txt Added compile definition to pass DIE_LIBRARY_GIT_TAG as DIELIB_TAG to C++
python/src/die.cpp Exposed DIELIB_TAG as module attribute dielib_tag
python/die/__init__.py Imported and exported dielib_tag; updated type hints to PEP 604 syntax; enhanced load_database to accept Path objects
python/tests/test_die.py Added assertions for dielib_tag; added redundant null checks; updated string quotes to double quotes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/tests/test_die.py
Comment thread python/tests/test_die.py
Comment thread cmake/FindDieLibrary.cmake Outdated
@calladoum-elastic

Copy link
Copy Markdown
Collaborator Author

Note: sticking to 09df9ccafe48a0531987ad1e605402ed79d4c3f6 for DieLibrary as more recent builds are (partially) broken

@calladoum-elastic calladoum-elastic merged commit 4338a64 into main Feb 19, 2026
26 checks passed
@calladoum-elastic calladoum-elastic deleted the calladoum/use-separate-file-for-dielib-git-tag branch February 19, 2026 16:15
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