Skip to content

Enhance and Clean Up by AI Agents

Choose a tag to compare

@luk036 luk036 released this 01 May 05:18
· 71 commits to master since this release

Release Notes: py2cpp 1.5.2

Release Date: May 1, 2026
GitHub Comparison: 1.5.1...1.5.2

Overview

Version 1.5.2 introduces major improvements to the testing infrastructure, including property-based testing with RapidCheck, extensive documentation enhancements across core containers, and various code quality improvements. This release also includes fixes for cross-platform compatibility and build system refinements.


✨ New Features

  • Property-Based Testing – Integrated RapidCheck framework for property-based tests alongside doctest:

    • 10 new property-based tests covering permutation (SJT, EHR) and combination (EMK) algorithms
    • Tests verify index validity, completeness, uniqueness, and generator properties
    • Conditional compilation support for optional dependencies
  • New Headers Added:

    • dict.hpp – Python-like dictionary implementation
    • fractions.hpp – Fraction arithmetic
    • set.hpp – Python-like set container
    • range.hpp – Python-like range/enumerate utilities
    • enumerate.hpp – Enumerate wrapper for containers
    • list.hpp – List-like container

📚 Documentation Improvements

Comprehensive Doxygen documentation has been added across all core components:

Component Documentation Added
dict.hpp Constructor docs, contains(), copy(), items(), at(), operator overloads
set.hpp Constructor docs, contains(), copy(), assignment operators
range.hpp begin(), end(), empty(), size(), contains(), operator[]
enumerate.hpp Iterator methods, wrapper behavior, const overloads
fractions.hpp Special case handling (inf, nan, zero comparisons)

🧪 Testing Improvements

  • CMake Test Configuration:

    • Added RapidCheck via CPM.cmake with master branch
    • Conditional linking with proper target detection (rapidcheck::rapidcheck or rapidcheck)
    • Disabled doctest auto-discovery to avoid conflicts – now using single CTest target
  • xmake Configuration:

    • Conditional RapidCheck support leveraging CMake-downloaded dependencies
  • Test Assertions – Migrated from CHECK/CHECK_FALSE to CHECK_EQ/CHECK_LT/CHECK_NE for better diagnostic output across:

    • test_dict.cpp
    • test_frac2.cpp
    • test_set.cpp
    • test_range.cpp
    • EdgeView and AtlasView tests
  • Total Test Coverage:

    • 45 doctest tests + 10 RapidCheck property-based tests = 55 total test cases

🔧 Build System Updates

  • CMake:

    • Minimum version remains 3.14, uses CPM.cmake for dependency management
    • Header-only INTERFACE library with proper include visibility
    • Column limit: 100 in .cmake-format
  • xmake:

    • Updated compiler flags: /EHsc /W4 /WX /wd4459 (replaced /wd4819 /wd4996)
    • Optimize level set to "fastest"
  • Cross-platform:

    • Added -Wno-deprecated-literal-operator for Termux build compatibility
    • CI support for Ubuntu, macOS, Windows via GitHub Actions

📝 Code Style & Conventions

  • Header-only: #pragma once throughout
  • No type suppression – explicit constructs only
  • Error handling: std::runtime_error / std::out_of_range
  • Conventional commits – feature branches, no force pushes to main

⚠️ Known Issues

  • Pre-existing crash in test_combin.cpp test case "Generate all combinations by emk_comb_gen" (SEH exception)
    • Occurs with or without RapidCheck integration
    • Blocks full test suite execution
    • Will be addressed in a future release

📊 Statistics

  • Files changed: 33
  • Additions: 1,286
  • Deletions: 589

Upgrading Notes

No breaking changes are introduced in this release. Existing code using py2cpp 1.5.1 should continue to work unchanged. For users who want to leverage the new property-based tests, ensure RapidCheck is available (CMake will fetch it automatically via CPM).


Contributors

  • @luk036 – Main development, documentation, build system updates

Links