IncludeCPP 4.6.8__tar.gz → 4.6.9__tar.gz

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.
Files changed (76) hide show
  1. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/PKG-INFO +1 -1
  2. {includecpp-4.6.8 → includecpp-4.6.9}/PKG-INFO +1 -1
  3. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/__init__.py +32 -1
  4. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/cli/commands.py +27 -6
  5. {includecpp-4.6.8 → includecpp-4.6.9}/pyproject.toml +1 -1
  6. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/SOURCES.txt +0 -0
  7. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/dependency_links.txt +0 -0
  8. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/entry_points.txt +0 -0
  9. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/requires.txt +0 -0
  10. {includecpp-4.6.8 → includecpp-4.6.9}/IncludeCPP.egg-info/top_level.txt +0 -0
  11. {includecpp-4.6.8 → includecpp-4.6.9}/LICENSE +0 -0
  12. {includecpp-4.6.8 → includecpp-4.6.9}/MANIFEST.in +0 -0
  13. {includecpp-4.6.8 → includecpp-4.6.9}/README.md +0 -0
  14. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/CHANGELOG.md +0 -0
  15. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/DOCUMENTATION.md +0 -0
  16. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/__init__.pyi +0 -0
  17. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/__main__.py +0 -0
  18. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/cli/__init__.py +0 -0
  19. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/cli/config_parser.py +0 -0
  20. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/__init__.py +0 -0
  21. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/ai_integration.py +0 -0
  22. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/build_manager.py +0 -0
  23. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cpp_api.py +0 -0
  24. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cpp_api.pyi +0 -0
  25. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cpp_api_extensions.pyi +0 -0
  26. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cppy_converter.py +0 -0
  27. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/CSSL_DOCUMENTATION.md +0 -0
  28. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/CSSL_DOCUMENTATION_NEW.md +0 -0
  29. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/__init__.py +0 -0
  30. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/build/api.pyd +0 -0
  31. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/build/cssl_core.pyi +0 -0
  32. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/build/libgcc_s_seh-1.dll +0 -0
  33. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/build/libstdc++-6.dll +0 -0
  34. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/build/libwinpthread-1.dll +0 -0
  35. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/cssl_core.cp +0 -0
  36. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cpp/cssl_lexer.hpp +0 -0
  37. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_builtins.py +0 -0
  38. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_builtins.pyi +0 -0
  39. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_compiler.py +0 -0
  40. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_events.py +0 -0
  41. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_languages.py +0 -0
  42. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_modules.py +0 -0
  43. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_optimizer.py +0 -0
  44. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_parser.py +0 -0
  45. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_runtime.py +0 -0
  46. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_syntax.py +0 -0
  47. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl/cssl_types.py +0 -0
  48. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl_bridge.py +0 -0
  49. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/cssl_bridge.pyi +0 -0
  50. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/error_catalog.py +0 -0
  51. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/error_formatter.py +0 -0
  52. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/exceptions.py +0 -0
  53. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/homeserver.py +0 -0
  54. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/path_discovery.py +0 -0
  55. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/project_ui.py +0 -0
  56. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/core/settings_ui.py +0 -0
  57. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/generator/__init__.py +0 -0
  58. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/generator/parser.cpp +0 -0
  59. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/generator/parser.h +0 -0
  60. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/generator/type_resolver.cpp +0 -0
  61. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/generator/type_resolver.h +0 -0
  62. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/py.typed +0 -0
  63. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/templates/cpp.proj.template +0 -0
  64. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/__init__.py +0 -0
  65. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/__init__.py +0 -0
  66. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/extension.js +0 -0
  67. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/images/cssl.png +0 -0
  68. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/images/cssl_pl.png +0 -0
  69. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/language-configuration.json +0 -0
  70. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/package.json +0 -0
  71. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/snippets/cssl.snippets.json +0 -0
  72. {includecpp-4.6.8 → includecpp-4.6.9}/includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +0 -0
  73. {includecpp-4.6.8 → includecpp-4.6.9}/requirements.txt +0 -0
  74. {includecpp-4.6.8 → includecpp-4.6.9}/setup.cfg +0 -0
  75. {includecpp-4.6.8 → includecpp-4.6.9}/setup.py +0 -0
  76. {includecpp-4.6.8 → includecpp-4.6.9}/tests/test_multilang.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 4.6.8
3
+ Version: 4.6.9
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 4.6.8
3
+ Version: 4.6.9
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
@@ -2,14 +2,31 @@ from .core.cpp_api import CppApi
2
2
  from .core import cssl_bridge as CSSL
3
3
  import warnings
4
4
  import os
5
+ import sys
5
6
  from pathlib import Path
6
7
 
7
- __version__ = "4.6.8"
8
+ __version__ = "4.6.9"
8
9
  __all__ = ["CppApi", "CSSL"]
9
10
 
10
11
  # Module-level cache for C++ modules
11
12
  _api_instance = None
12
13
  _loaded_modules = {}
14
+ _frozen_api = None # Cached API module for frozen (PyInstaller) mode
15
+
16
+ def _is_frozen():
17
+ """Check if running in a frozen PyInstaller bundle."""
18
+ return getattr(sys, 'frozen', False)
19
+
20
+ def _get_frozen_api():
21
+ """Get the bundled API module when running frozen."""
22
+ global _frozen_api
23
+ if _frozen_api is None:
24
+ try:
25
+ import api
26
+ _frozen_api = api
27
+ except ImportError:
28
+ _frozen_api = False # Mark as not available
29
+ return _frozen_api if _frozen_api else None
13
30
 
14
31
  def _get_api():
15
32
  """Get or create singleton CppApi instance.
@@ -43,6 +60,20 @@ def __getattr__(name: str):
43
60
  if name in _loaded_modules:
44
61
  return _loaded_modules[name]
45
62
 
63
+ # In frozen mode (PyInstaller), try to get module from bundled api
64
+ if _is_frozen():
65
+ frozen_api = _get_frozen_api()
66
+ if frozen_api and hasattr(frozen_api, name):
67
+ module = getattr(frozen_api, name)
68
+ _loaded_modules[name] = module
69
+ return module
70
+ # If not found in frozen api, raise helpful error
71
+ raise AttributeError(
72
+ f"Module '{name}' not found in bundled executable. "
73
+ f"Ensure it was included during build with 'includecpp --make-exe'."
74
+ )
75
+
76
+ # Normal mode: use CppApi
46
77
  api = _get_api()
47
78
 
48
79
  if name not in api.registry:
@@ -430,10 +430,17 @@ def _show_doc(search_term: str = None):
430
430
  _safe_echo("=" * 70)
431
431
 
432
432
 
433
- def _make_executable(script_path: str, onefile: bool = True, console: bool = True, icon: str = None):
433
+ def _make_executable(script_path: str, output_name: str = None, onefile: bool = True, console: bool = True, icon: str = None):
434
434
  """Build .exe from Python script using PyInstaller.
435
435
 
436
436
  Auto-detects dependencies, rebuilds includecpp if needed, and cleans up.
437
+
438
+ Args:
439
+ script_path: Path to the Python script
440
+ output_name: Optional custom name for output executable (without .exe)
441
+ onefile: Build as single file (True) or directory (False)
442
+ console: Show console window (True) or windowed mode (False)
443
+ icon: Path to icon file (.ico)
437
444
  """
438
445
  import re
439
446
  import shutil
@@ -449,10 +456,12 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
449
456
  return
450
457
 
451
458
  script_dir = script_path.parent
452
- script_name = script_path.stem
459
+ script_name = output_name if output_name else script_path.stem
453
460
 
454
461
  click.echo()
455
462
  click.secho(f"Building executable from: {script_path.name}", fg='cyan', bold=True)
463
+ if output_name:
464
+ click.echo(f" Output name: {output_name}.exe")
456
465
  click.echo("=" * 50)
457
466
 
458
467
  # Check if PyInstaller is installed
@@ -511,6 +520,7 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
511
520
 
512
521
  # Build data files list for PyInstaller
513
522
  datas = []
523
+ binaries = [] # For .pyd/.so files
514
524
  hidden_imports = []
515
525
 
516
526
  # If includecpp is used, rebuild and include the compiled modules
@@ -544,6 +554,7 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
544
554
  # Rebuild the modules
545
555
  click.echo(" Rebuilding C++ modules...")
546
556
  try:
557
+ from ..core.cpp_api import CppApi
547
558
  api = CppApi(config_path=cpp_proj_path)
548
559
  api.rebuild()
549
560
  click.secho(" Rebuild complete!", fg='green')
@@ -561,8 +572,8 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
561
572
 
562
573
  for pyd_file in pyd_files:
563
574
  click.echo(f" Including: {pyd_file.name}")
564
- # Add to includecpp package location
565
- datas.append((str(pyd_file), 'includecpp'))
575
+ # Add as binary to root (importable as 'api')
576
+ binaries.append((str(pyd_file), '.'))
566
577
 
567
578
  if pyd_files:
568
579
  click.secho(f" Added {len(pyd_files)} compiled module(s)", fg='green')
@@ -575,6 +586,7 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
575
586
  click.secho(" Warning: cpp.proj not found. C++ modules may not be included.", fg='yellow')
576
587
 
577
588
  hidden_imports.append('includecpp')
589
+ hidden_imports.append('api') # The compiled module
578
590
 
579
591
  # Add GUI-specific settings
580
592
  if uses_pyqt6:
@@ -613,10 +625,18 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
613
625
  if icon:
614
626
  cmd.extend(['--icon', str(Path(icon).resolve())])
615
627
 
628
+ # Set output name if specified
629
+ if output_name:
630
+ cmd.extend(['--name', output_name])
631
+
616
632
  # Add data files
617
633
  for src, dest in datas:
618
634
  cmd.extend(['--add-data', f'{src}{os.pathsep}{dest}'])
619
635
 
636
+ # Add binary files (.pyd/.so)
637
+ for src, dest in binaries:
638
+ cmd.extend(['--add-binary', f'{src}{os.pathsep}{dest}'])
639
+
620
640
  # Add hidden imports
621
641
  for imp in hidden_imports:
622
642
  cmd.extend(['--hidden-import', imp])
@@ -706,6 +726,7 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
706
726
  @click.option('--changelog', 'show_changelog', is_flag=True, help='Show changelog (last 2 releases by default)')
707
727
  @click.option('--all', 'changelog_all', is_flag=True, help='Show all changelog entries (use with --changelog)')
708
728
  @click.option('--make-exe', 'make_exe_path', type=click.Path(exists=True), help='Build .exe from Python script')
729
+ @click.option('--exe-name', 'exe_name', type=str, help='Output executable name (without .exe)')
709
730
  @click.option('--onefile/--onedir', 'onefile', default=True, help='Build as single file or directory (default: onefile)')
710
731
  @click.option('--console/--windowed', 'console', default=True, help='Show console window or not (default: console)')
711
732
  @click.option('--icon', type=click.Path(exists=True), help='Icon file for executable (.ico)')
@@ -720,7 +741,7 @@ def _make_executable(script_path: str, onefile: bool = True, console: bool = Tru
720
741
  @click.option('--9', 'changelog_9', is_flag=True, hidden=True)
721
742
  @click.option('--10', 'changelog_10', is_flag=True, hidden=True)
722
743
  @click.pass_context
723
- def cli(ctx, doc_search, doc_flag, show_changelog, changelog_all, make_exe_path, onefile, console, icon,
744
+ def cli(ctx, doc_search, doc_flag, show_changelog, changelog_all, make_exe_path, exe_name, onefile, console, icon,
724
745
  changelog_1, changelog_2, changelog_3, changelog_4, changelog_5, changelog_6, changelog_7,
725
746
  changelog_8, changelog_9, changelog_10):
726
747
  """IncludeCPP - C++ Performance in Python, Zero Hassle
@@ -766,7 +787,7 @@ def cli(ctx, doc_search, doc_flag, show_changelog, changelog_all, make_exe_path,
766
787
 
767
788
  # Handle --make-exe
768
789
  if make_exe_path:
769
- _make_executable(make_exe_path, onefile=onefile, console=console, icon=icon)
790
+ _make_executable(make_exe_path, output_name=exe_name, onefile=onefile, console=console, icon=icon)
770
791
  ctx.exit(0)
771
792
 
772
793
  # If no subcommand is given, show help
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "IncludeCPP"
7
- version = "4.6.8"
7
+ version = "4.6.9"
8
8
  description = "Professional C++ Python bindings with type-generic templates, pystubs and native threading"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes