Skip to content

Fix missing Rust function implementations causing build failure#126

Draft
Copilot wants to merge 4 commits into
feature/25-resource-versioningfrom
copilot/sub-pr-27
Draft

Fix missing Rust function implementations causing build failure#126
Copilot wants to merge 4 commits into
feature/25-resource-versioningfrom
copilot/sub-pr-27

Conversation

Copilot AI commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

The PR registered get_build_info() and get_resource_info() in the Python module but never implemented them in Rust, causing compilation to fail.

Changes

Implemented missing Rust functions (src/lib.rs):

  • get_build_info() - Parses embedded metadata.json, returns build info as HashMap
  • get_resource_info() - Converts JSON resource metadata to Python dict via PyO3
  • Added build.rs to capture rustc version at compile time

Fixed linting issues:

  • Removed unused serde::{Deserialize, Serialize} imports
  • Fixed clippy warning: empty line after doc comment in morphotactics.rs
  • Updated deprecated PyObject to Py<PyAny>
  • Updated Python type hints: Dictdict
  • Fixed line length violations in info.py and generate_resource_metadata.py
  • Fixed BibTeX formatting: removed newlines from note field

Fixed test:

  • Updated assertion to match actual formatted output (padding spaces)

Usage

from durak import get_build_info, get_resource_info, print_reproducibility_report

# Query build metadata
build_info = get_build_info()
# {'durak_version': '0.4.0', 'rust_version': '1.92.0', ...}

# Query resource checksums and versions
resources = get_resource_info()
# {'stopwords_base': {'checksum': '361908...', 'item_count': 118, ...}, ...}

# Generate reproducibility report
print_reproducibility_report()

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 28, 2026 09:48
Co-authored-by: fbkaragoz <59958216+fbkaragoz@users.noreply.github.com>
- Add get_build_info() and get_resource_info() implementations in src/lib.rs
- Add build.rs to capture Rust version at compile time
- Fix unused import warnings (remove serde Deserialize/Serialize)
- Fix clippy warning in morphotactics.rs (empty line after doc comment)
- Fix PyObject deprecation warning (use Py<PyAny>)
- Fix Python linting errors in info.py and generate_resource_metadata.py
- Update type stubs to use dict instead of Dict
- Fix test assertion to match actual output format
- All 26 resource versioning tests now pass

Co-authored-by: fbkaragoz <59958216+fbkaragoz@users.noreply.github.com>
- Reformat note field to single line (no embedded newlines)
- Add intermediate variable for better code organization
- All tests still pass

Co-authored-by: fbkaragoz <59958216+fbkaragoz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add resource versioning and reproducibility tracking Fix missing Rust function implementations causing build failure Jan 28, 2026
Copilot AI requested a review from fbkaragoz January 28, 2026 10:01
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