IncludeCPP 3.3.20__py3-none-any.whl → 3.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@
8
8
  #include <functional>
9
9
  #include <filesystem>
10
10
  #include <iterator>
11
+ #include <set>
11
12
 
12
13
  int API::main(int argc, char* argv[]) {
13
14
  if (argc < 5) {
@@ -489,6 +490,27 @@ ModuleDescriptor API::parse_cp_file(const std::string& filepath) {
489
490
  sig.param_types.push_back(parts[i]);
490
491
  }
491
492
 
493
+ // v3.3.22: Also populate parameters for display in get command
494
+ for (size_t i = 0; i < sig.param_types.size(); ++i) {
495
+ ParameterInfo param;
496
+ std::string type_str = sig.param_types[i];
497
+ param.type = type_str;
498
+ param.name = "arg" + std::to_string(i + 1);
499
+ // Check for const
500
+ if (type_str.find("const ") != std::string::npos) {
501
+ param.is_const = true;
502
+ }
503
+ // Check for reference
504
+ if (!type_str.empty() && type_str.back() == '&') {
505
+ param.is_reference = true;
506
+ }
507
+ // Check for pointer
508
+ if (!type_str.empty() && type_str.back() == '*') {
509
+ param.is_pointer = true;
510
+ }
511
+ sig.parameters.push_back(param);
512
+ }
513
+
492
514
  cb.method_signatures.push_back(sig);
493
515
  // Also add to legacy methods list for backward compatibility
494
516
  cb.methods.push_back(sig.name);
@@ -678,6 +700,47 @@ ModuleDescriptor API::parse_cp_file(const std::string& filepath) {
678
700
  validate_namespace_includecpp(desc.source_path, desc.module_name);
679
701
  }
680
702
 
703
+ // v3.4.1: Auto-detect header from #include directives in source file
704
+ if (!desc.has_header && !desc.source_path.empty()) {
705
+ std::ifstream source_file(desc.source_path);
706
+ if (source_file.is_open()) {
707
+ std::string line;
708
+ std::regex include_regex(R"(^\s*#include\s*"([^"]+\.h(?:pp)?)")");
709
+ std::smatch match;
710
+
711
+ while (std::getline(source_file, line)) {
712
+ if (std::regex_search(line, match, include_regex)) {
713
+ std::string header_name = match[1].str();
714
+ // Skip standard headers and pybind11 headers
715
+ if (header_name.find("pybind11") == std::string::npos &&
716
+ header_name.find("std") == std::string::npos) {
717
+ // Found a local header - construct the path
718
+ std::filesystem::path source_path(desc.source_path);
719
+ std::filesystem::path header_path = source_path.parent_path() / header_name;
720
+
721
+ // Check if the header file exists
722
+ if (std::filesystem::exists(header_path)) {
723
+ desc.header_path = header_path.string();
724
+ desc.has_header = true;
725
+ std::cout << "NOTE: Auto-detected header for '" << desc.module_name
726
+ << "': " << desc.header_path << std::endl;
727
+ break;
728
+ }
729
+ // Also try in include/ subdirectory
730
+ header_path = source_path.parent_path().parent_path() / "include" / header_name;
731
+ if (std::filesystem::exists(header_path)) {
732
+ desc.header_path = header_path.string();
733
+ desc.has_header = true;
734
+ std::cout << "NOTE: Auto-detected header for '" << desc.module_name
735
+ << "': " << desc.header_path << std::endl;
736
+ break;
737
+ }
738
+ }
739
+ }
740
+ }
741
+ }
742
+ }
743
+
681
744
  return desc;
682
745
  }
683
746
 
@@ -901,6 +964,11 @@ std::string API::generate_pybind11_code(const std::vector<ModuleDescriptor>& mod
901
964
  code << "#include <pybind11/complex.h>\n";
902
965
  code << "#include <pybind11/chrono.h>\n\n";
903
966
 
967
+ // v3.3.22: Track included headers to prevent duplicates
968
+ std::set<std::string> included_headers;
969
+ std::vector<std::string> ordered_includes;
970
+
971
+ // First pass: collect all headers and detect dependencies
904
972
  for (const auto& mod : modules) {
905
973
  std::string include_path;
906
974
  if (mod.has_header) {
@@ -912,6 +980,19 @@ std::string API::generate_pybind11_code(const std::vector<ModuleDescriptor>& mod
912
980
  << "' has no separate header, including source file: "
913
981
  << include_path << std::endl;
914
982
  }
983
+
984
+ // Skip if already included
985
+ if (included_headers.find(include_path) != included_headers.end()) {
986
+ std::cout << "NOTE: Skipping duplicate include: " << include_path << std::endl;
987
+ continue;
988
+ }
989
+
990
+ included_headers.insert(include_path);
991
+ ordered_includes.push_back(include_path);
992
+ }
993
+
994
+ // Generate includes (duplicates already filtered)
995
+ for (const auto& include_path : ordered_includes) {
915
996
  code << "#include \"" << include_path << "\"\n";
916
997
  }
917
998
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.3.20
3
+ Version: 3.4.2
4
4
  Summary: Professional C++ Python bindings with type-generic templates, pystubs and native threading
5
5
  Home-page: https://github.com/liliassg/IncludeCPP
6
6
  Author: Lilias Hatterscheidt
@@ -625,6 +625,50 @@ Use at your own discretion. Report issues at: https://github.com/hatte/IncludeCP
625
625
 
626
626
  # Changelog
627
627
 
628
+ ## v3.4.2
629
+ - **New Feature: `exec` Command**
630
+ - Interactive REPL for quick code testing without creating files
631
+ - `includecpp exec py` - Python REPL with IncludeCPP support
632
+ - `includecpp exec cpp` - C++ REPL with auto-compilation
633
+ - Auto-import modules: `includecpp exec py mymodule`
634
+ - Auto-import from plugins: `includecpp exec py plugins/math.cp`
635
+ - Import all modules: `includecpp exec py --all`
636
+ - Enter code line by line, press ENTER on empty line to execute
637
+
638
+ ## v3.4.1
639
+ - **Bug Fixes:**
640
+ - fix command: Fixed false positives for unused variables (sum, memory_) using word-boundary matching
641
+ - CPPY: C++ reserved words (double, int, void, etc.) now properly escaped as Python identifiers
642
+ - CPPY: C++ STL functions (accumulate, find, sort, reverse) properly converted to Python equivalents
643
+ - CPPY: Member variables with trailing underscore (memory_) now get self. prefix
644
+ - CPPY: Private class members now detected for self. prefix conversion
645
+ - Plugin: Auto-detect header files from #include directives in source files
646
+
647
+ ## v3.4.0
648
+ - **CodeMaker Major Update:**
649
+ - New Source node type with 8 connection ports for code generation
650
+ - Smart code generation: Source nodes generate Python/Plugin files with all connected nodes included
651
+ - Right-click on Source node: "Create Python" creates .py in project root
652
+ - Right-click on Source node: "Create Plugin" creates .cp, .h, .cpp in plugins/ and include/
653
+ - Code options hidden after file generation (prevents duplicates)
654
+ - Enhanced description display with background rect in node body
655
+ - Arrow key navigation to pan the canvas
656
+ - New toolbar buttons: Align H, Align V, Auto-Arrange
657
+ - Quick-add buttons: +Source, +Class, +Function
658
+ - Properties Panel on the right side for editing selected nodes
659
+ - Auto-arrange algorithm for grid layout
660
+ - Align horizontal/vertical for selected nodes
661
+ - **Bug Fixes:**
662
+ - Changelog encoding fixes for Windows console
663
+ - CPPY C++ keyword escaping (double, int, etc.)
664
+ - CPPY C++ to Python syntax conversion improvements
665
+ - CPPY self. prefix for member variables
666
+ - Plugin auto-header detection from #include
667
+
668
+ ## v3.3.21
669
+ - **Encoding Fixes:**
670
+ - Replaced Unicode arrow characters with ASCII in changelog (Windows console compatibility)
671
+
628
672
  ## v3.3.20
629
673
  - **Bug Fixes:**
630
674
  - Fixed `QPoint.toPoint()` AttributeError in rubber band selection
@@ -657,7 +701,7 @@ Use at your own discretion. Report issues at: https://github.com/hatte/IncludeCP
657
701
 
658
702
  ## v3.3.16-3.3.17
659
703
  - **QPen Bug Fixes:**
660
- - Fixed 3 instances of `setPen(Qt.PenStyle.NoPen)` `setPen(QPen(Qt.PenStyle.NoPen))`
704
+ - Fixed 3 instances of `setPen(Qt.PenStyle.NoPen)` to `setPen(QPen(Qt.PenStyle.NoPen))`
661
705
  - Proper QPen construction for PyQt6 compatibility
662
706
 
663
707
  ## v3.3.15
@@ -697,7 +741,7 @@ Use at your own discretion. Report issues at: https://github.com/hatte/IncludeCP
697
741
 
698
742
  ## v3.3.12
699
743
  - **Smart Type Inference:**
700
- - Parameter types now inferred from common naming patterns (start/end int, name/path string, etc.)
744
+ - Parameter types now inferred from common naming patterns (start/end -> int, name/path -> string, etc.)
701
745
  - Variable type tracking throughout conversion for accurate string detection
702
746
  - Loop variable types inferred from iterables (enumerate, for loops)
703
747
  - **String Conversion Fix:**
@@ -762,4 +806,4 @@ Use at your own discretion. Report issues at: https://github.com/hatte/IncludeCP
762
806
 
763
807
  ---
764
808
 
765
- MIT License | v3.3.20 | [GitHub](https://github.com/liliassg/IncludeCPP)
809
+ MIT License | v3.4.2 | [GitHub](https://github.com/liliassg/IncludeCPP)
@@ -0,0 +1,40 @@
1
+ includecpp/__init__.py,sha256=kqL0S09fmUWRoVpKUN-_2lufQHL-zcd8Y80CGDfWZ5M,1613
2
+ includecpp/__init__.pyi,sha256=gNfQTFiM0z-Z2xazX7Hk5ULtW44lEU2j6hGEipcipMY,3637
3
+ includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
4
+ includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ includecpp/cli/__init__.py,sha256=Yda-4a5QJb_tKu35YQNfc5lu-LewTsM5abqNNkzS47M,113
6
+ includecpp/cli/commands.py,sha256=90-L9iy4qIvyZR5KlMPSI5YNN7cb_1e6D5p-MTPkYJo,316845
7
+ includecpp/cli/config_parser.py,sha256=KveeYUg2TA9sC5hKVzYYfgdNm2WfLG5y7_yxgBWn9yM,4886
8
+ includecpp/core/__init__.py,sha256=L1bT6oikTjdto-6Px7DpjePtM07ymo3Bnov1saZzsGg,390
9
+ includecpp/core/ai_integration.py,sha256=PW6yFDqdXjfchpfKTKg59AOLhLry9kqJEGf_65BztrY,87603
10
+ includecpp/core/build_manager.py,sha256=uLuYsuiC6OsOGaU5wAJfl4M3IbdnIDgogfMd8VsVpq8,102866
11
+ includecpp/core/cpp_api.py,sha256=8y_B1L18rhSBZln654xPPzqO2PdvAlLpJrfEjzl7Wnc,14039
12
+ includecpp/core/cpp_api.pyi,sha256=IEiaKqaPItnn6rjL7aK32D3o9FYmRYCgCZbqiQNUwdc,3496
13
+ includecpp/core/cppy_converter.py,sha256=b7yqu-aoa0wShNY0GvQT67TnNhYya4GyYmG7oDdqDV4,156686
14
+ includecpp/core/cssl_bridge.py,sha256=V_55W-h4vRE0m-O1bJS5Lb_ywq9Tiq-1apG6gtiKVVk,4166
15
+ includecpp/core/error_catalog.py,sha256=VS3N-P0yEbiHimsDPtcaYfrUb7mXQ-7pqw18PtSngaU,33869
16
+ includecpp/core/error_formatter.py,sha256=7-MzRIT8cM4uODxy0IZ9pu7pqR4Pq2I8Si0QQZHjmVc,39239
17
+ includecpp/core/exceptions.py,sha256=szeF4qdzi_q8hBBZi7mJxkliyQ0crplkLYe0ymlBGtk,2459
18
+ includecpp/core/path_discovery.py,sha256=jI0oSq6Hsd4LKXmU4dOiGSrXcEO_KWMXfQ5_ylBmXvU,2561
19
+ includecpp/core/project_ui.py,sha256=la2EQZKmUkJGuJxnbs09hH1ZhBh9bfndo6okzZsk2dQ,141134
20
+ includecpp/core/settings_ui.py,sha256=B2SlwgdplF2KiBk5UYf2l8Jjifjd0F-FmBP0DPsVCEQ,11798
21
+ includecpp/core/cssl/__init__.py,sha256=DZMkRkjBNCxSJ27x4elPIKbxgEFyLnKFZSIki91xVKc,1551
22
+ includecpp/core/cssl/cssl_builtins.py,sha256=PDz4FoWqNdGjBTBLKJ2fc8SqFKpprSey_9gZxV19tIE,61896
23
+ includecpp/core/cssl/cssl_events.py,sha256=nupIcXW_Vjdud7zCU6hdwkQRQ0MujlPM7Tk2u7eDAiY,21013
24
+ includecpp/core/cssl/cssl_modules.py,sha256=cUg0-zdymMnWWTsA_BUrW5dx4R04dHpKcUhm-Wfiwwo,103006
25
+ includecpp/core/cssl/cssl_parser.py,sha256=mSvskKx66UvhmhxjgjfiBLfLylesaY50RsJcDBFK3so,60004
26
+ includecpp/core/cssl/cssl_runtime.py,sha256=Qz6gNTuul-V73oAm8bE4JqnCLHIxMSWjskSEuLP_Lmg,59097
27
+ includecpp/core/cssl/cssl_syntax.py,sha256=vgI-dgj6gs9cOHwNRff6JbwZZYW_fYutnwCkznlgZiE,17006
28
+ includecpp/core/cssl/cssl_types.py,sha256=W5QAkFOHW0g6DaqQHk23bSBDvfLFTjHiTObLjfuHTo4,13003
29
+ includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
30
+ includecpp/generator/parser.cpp,sha256=CxVpsBDb22yDaVqp0ljh7dFKBTGlUj65apUGtPRMu0s,76829
31
+ includecpp/generator/parser.h,sha256=EDm0b-pEesIIIQQ2PvH5h2qwlqJU9BH8SiMV7MWbsTo,11073
32
+ includecpp/generator/type_resolver.cpp,sha256=MmFK_4HXd1wqxALDiDyXVuU397SXoQL_o5zb_8N8Hzs,12346
33
+ includecpp/generator/type_resolver.h,sha256=ZsaxQqcCcKJJApYn7KOp2dLlQ1VFVG_oZDjaK5LhBSg,2590
34
+ includecpp/templates/cpp.proj.template,sha256=Iy-L8I4Cl3tIgBMx1Qp5h6gURvkqOAqyodVHuDJ0Luw,359
35
+ includecpp-3.4.2.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
36
+ includecpp-3.4.2.dist-info/METADATA,sha256=ji6ffwWqoUKcDfI17Tl5jQK4TgytuLJjZutCUWRD4oM,26654
37
+ includecpp-3.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ includecpp-3.4.2.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
39
+ includecpp-3.4.2.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
40
+ includecpp-3.4.2.dist-info/RECORD,,
@@ -1,31 +0,0 @@
1
- includecpp/__init__.py,sha256=e3MYUBdHTtaJKUe-ATJe7xrI_Cbj8dSJ2IHE3_OXKrk,1560
2
- includecpp/__init__.pyi,sha256=gNfQTFiM0z-Z2xazX7Hk5ULtW44lEU2j6hGEipcipMY,3637
3
- includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
4
- includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- includecpp/cli/__init__.py,sha256=Yda-4a5QJb_tKu35YQNfc5lu-LewTsM5abqNNkzS47M,113
6
- includecpp/cli/commands.py,sha256=WL9xYBVduvqdoQbzkn03-ht415y3_tO8MNw2YYLRKao,304557
7
- includecpp/cli/config_parser.py,sha256=KveeYUg2TA9sC5hKVzYYfgdNm2WfLG5y7_yxgBWn9yM,4886
8
- includecpp/core/__init__.py,sha256=L1bT6oikTjdto-6Px7DpjePtM07ymo3Bnov1saZzsGg,390
9
- includecpp/core/ai_integration.py,sha256=PW6yFDqdXjfchpfKTKg59AOLhLry9kqJEGf_65BztrY,87603
10
- includecpp/core/build_manager.py,sha256=uLuYsuiC6OsOGaU5wAJfl4M3IbdnIDgogfMd8VsVpq8,102866
11
- includecpp/core/cpp_api.py,sha256=8y_B1L18rhSBZln654xPPzqO2PdvAlLpJrfEjzl7Wnc,14039
12
- includecpp/core/cpp_api.pyi,sha256=IEiaKqaPItnn6rjL7aK32D3o9FYmRYCgCZbqiQNUwdc,3496
13
- includecpp/core/cppy_converter.py,sha256=T6cjvgSwRD6E6_zV4B1LL3sKqCK1LxjneQIpzc4ifBY,150309
14
- includecpp/core/error_catalog.py,sha256=VS3N-P0yEbiHimsDPtcaYfrUb7mXQ-7pqw18PtSngaU,33869
15
- includecpp/core/error_formatter.py,sha256=7-MzRIT8cM4uODxy0IZ9pu7pqR4Pq2I8Si0QQZHjmVc,39239
16
- includecpp/core/exceptions.py,sha256=szeF4qdzi_q8hBBZi7mJxkliyQ0crplkLYe0ymlBGtk,2459
17
- includecpp/core/path_discovery.py,sha256=jI0oSq6Hsd4LKXmU4dOiGSrXcEO_KWMXfQ5_ylBmXvU,2561
18
- includecpp/core/project_ui.py,sha256=NtAiMm9onGWYohjwvDG6Qv22m1OZuE9n9k4iR9WSR7M,112611
19
- includecpp/core/settings_ui.py,sha256=B2SlwgdplF2KiBk5UYf2l8Jjifjd0F-FmBP0DPsVCEQ,11798
20
- includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
21
- includecpp/generator/parser.cpp,sha256=WA491gF1jmMV5Xl-hYKz0lqIPxR-tqaO5GptGKcm7Ds,72521
22
- includecpp/generator/parser.h,sha256=EDm0b-pEesIIIQQ2PvH5h2qwlqJU9BH8SiMV7MWbsTo,11073
23
- includecpp/generator/type_resolver.cpp,sha256=MmFK_4HXd1wqxALDiDyXVuU397SXoQL_o5zb_8N8Hzs,12346
24
- includecpp/generator/type_resolver.h,sha256=ZsaxQqcCcKJJApYn7KOp2dLlQ1VFVG_oZDjaK5LhBSg,2590
25
- includecpp/templates/cpp.proj.template,sha256=Iy-L8I4Cl3tIgBMx1Qp5h6gURvkqOAqyodVHuDJ0Luw,359
26
- includecpp-3.3.20.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
27
- includecpp-3.3.20.dist-info/METADATA,sha256=alndbXkWPVuJmaxQphlwjYojGotFloo175H-EycL3Mk,24361
28
- includecpp-3.3.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- includecpp-3.3.20.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
30
- includecpp-3.3.20.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
31
- includecpp-3.3.20.dist-info/RECORD,,