IncludeCPP 2.3.3__tar.gz → 2.3.4__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.
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/PKG-INFO +1 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/SOURCES.txt +0 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/PKG-INFO +1 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/__init__.py +1 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/build_manager.py +9 -130
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/cpp_api.py +0 -17
- {includecpp-2.3.3 → includecpp-2.3.4}/pyproject.toml +1 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/setup.py +1 -4
- includecpp-2.3.3/includecpp/inbuilds/__init__.py +0 -1
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/dependency_links.txt +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/entry_points.txt +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/requires.txt +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/IncludeCPP.egg-info/top_level.txt +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/LICENSE +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/MANIFEST.in +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/README.md +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/__init__.pyi +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/__main__.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/cli/__init__.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/cli/commands.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/cli/config_parser.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/__init__.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/cpp_api.pyi +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/error_formatter.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/core/exceptions.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/generator/__init__.py +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/generator/parser.cpp +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/generator/parser.h +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/generator/type_resolver.cpp +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/generator/type_resolver.h +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/includecpp/templates/cpp.proj.template +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/requirements.txt +0 -0
- {includecpp-2.3.3 → includecpp-2.3.4}/setup.cfg +0 -0
|
@@ -30,18 +30,12 @@ class BuildManager:
|
|
|
30
30
|
self.bindings_dir = build_dir / "bindings"
|
|
31
31
|
self.cmake_build_dir = build_dir / "build"
|
|
32
32
|
|
|
33
|
-
# Inbuilds directory (from package)
|
|
34
|
-
package_root = Path(__file__).parent.parent
|
|
35
|
-
self.inbuilds_source_dir = package_root / "inbuilds"
|
|
36
|
-
self.inbuilds_build_dir = build_dir / "inbuilds"
|
|
37
|
-
|
|
38
33
|
self.gen_exe = self.bin_dir / self._get_exe_name("plugin_gen")
|
|
39
34
|
self.registry_file = build_dir / ".module_registry.json"
|
|
40
35
|
|
|
41
36
|
self.bin_dir.mkdir(parents=True, exist_ok=True)
|
|
42
37
|
self.bindings_dir.mkdir(parents=True, exist_ok=True)
|
|
43
38
|
self.cmake_build_dir.mkdir(parents=True, exist_ok=True)
|
|
44
|
-
self.inbuilds_build_dir.mkdir(parents=True, exist_ok=True)
|
|
45
39
|
|
|
46
40
|
def _get_exe_name(self, base_name: str) -> str:
|
|
47
41
|
"""Get platform-specific executable name."""
|
|
@@ -170,41 +164,6 @@ class BuildManager:
|
|
|
170
164
|
return compiler
|
|
171
165
|
return None
|
|
172
166
|
|
|
173
|
-
def _copy_inbuilds(self, verbose: bool = False) -> int:
|
|
174
|
-
"""Copy inbuilt modules to build directory.
|
|
175
|
-
|
|
176
|
-
Returns:
|
|
177
|
-
Number of inbuilds copied
|
|
178
|
-
"""
|
|
179
|
-
if not self.inbuilds_source_dir.exists():
|
|
180
|
-
if verbose:
|
|
181
|
-
print("No inbuilds directory found in package")
|
|
182
|
-
return 0
|
|
183
|
-
|
|
184
|
-
copied_count = 0
|
|
185
|
-
|
|
186
|
-
for inbuild_dir in self.inbuilds_source_dir.iterdir():
|
|
187
|
-
if not inbuild_dir.is_dir():
|
|
188
|
-
continue
|
|
189
|
-
|
|
190
|
-
# Check if this is a valid inbuild (has .cp file)
|
|
191
|
-
cp_file = inbuild_dir / f"{inbuild_dir.name}.cp"
|
|
192
|
-
if not cp_file.exists():
|
|
193
|
-
continue
|
|
194
|
-
|
|
195
|
-
# Copy to build directory
|
|
196
|
-
dest_dir = self.inbuilds_build_dir / inbuild_dir.name
|
|
197
|
-
if dest_dir.exists():
|
|
198
|
-
shutil.rmtree(dest_dir)
|
|
199
|
-
|
|
200
|
-
shutil.copytree(inbuild_dir, dest_dir)
|
|
201
|
-
copied_count += 1
|
|
202
|
-
|
|
203
|
-
if verbose:
|
|
204
|
-
print(f"Copied inbuild: {inbuild_dir.name}")
|
|
205
|
-
|
|
206
|
-
return copied_count
|
|
207
|
-
|
|
208
167
|
def _scan_plugins(self, verbose: bool = False) -> List[Path]:
|
|
209
168
|
"""Scan user's plugins directory for .cp files."""
|
|
210
169
|
if not self.plugins_dir.exists():
|
|
@@ -226,102 +185,22 @@ class BuildManager:
|
|
|
226
185
|
|
|
227
186
|
return cp_files
|
|
228
187
|
|
|
229
|
-
def
|
|
230
|
-
"""
|
|
188
|
+
def _generate_bindings(self, verbose: bool = False):
|
|
189
|
+
"""Run plugin_gen.exe to generate bindings.cpp for user plugins."""
|
|
231
190
|
|
|
232
|
-
Returns:
|
|
233
|
-
Tuple of (user_plugins, inbuild_plugins)
|
|
234
|
-
"""
|
|
235
191
|
# Scan user plugins
|
|
236
192
|
user_plugins = self._scan_plugins(verbose)
|
|
237
193
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if self.inbuilds_build_dir.exists():
|
|
241
|
-
for inbuild_dir in self.inbuilds_build_dir.iterdir():
|
|
242
|
-
if inbuild_dir.is_dir():
|
|
243
|
-
cp_file = inbuild_dir / f"{inbuild_dir.name}.cp"
|
|
244
|
-
if cp_file.exists():
|
|
245
|
-
inbuild_plugins.append(cp_file)
|
|
246
|
-
|
|
247
|
-
if verbose and inbuild_plugins:
|
|
248
|
-
print(f"Found {len(inbuild_plugins)} inbuild plugin(s): {[f.stem for f in inbuild_plugins]}")
|
|
249
|
-
|
|
250
|
-
return user_plugins, inbuild_plugins
|
|
251
|
-
|
|
252
|
-
def _generate_bindings(self, verbose: bool = False):
|
|
253
|
-
"""Run plugin_gen.exe to generate bindings.cpp for user plugins AND inbuilds."""
|
|
254
|
-
|
|
255
|
-
# Copy inbuilds to build directory first
|
|
256
|
-
inbuilds_count = self._copy_inbuilds(verbose)
|
|
257
|
-
if verbose and inbuilds_count > 0:
|
|
258
|
-
print(f"Copied {inbuilds_count} inbuilt module(s)")
|
|
259
|
-
|
|
260
|
-
# Create combined plugins directory with symlinks
|
|
261
|
-
combined_plugins_dir = self.build_dir / "all_plugins"
|
|
262
|
-
if combined_plugins_dir.exists():
|
|
263
|
-
shutil.rmtree(combined_plugins_dir)
|
|
264
|
-
combined_plugins_dir.mkdir(parents=True, exist_ok=True)
|
|
265
|
-
|
|
266
|
-
# Copy user plugins (as files, not symlinks for cross-platform compatibility)
|
|
267
|
-
user_plugins = list(self.plugins_dir.glob("*.cp"))
|
|
268
|
-
for cp_file in user_plugins:
|
|
269
|
-
dest = combined_plugins_dir / cp_file.name
|
|
270
|
-
shutil.copy2(cp_file, dest)
|
|
271
|
-
if verbose:
|
|
272
|
-
print(f"Added user plugin: {cp_file.name}")
|
|
273
|
-
|
|
274
|
-
# Copy inbuild .cp files with path adjustments
|
|
275
|
-
inbuild_count = 0
|
|
276
|
-
if self.inbuilds_build_dir.exists():
|
|
277
|
-
for inbuild_dir in self.inbuilds_build_dir.iterdir():
|
|
278
|
-
if inbuild_dir.is_dir():
|
|
279
|
-
cp_file = inbuild_dir / f"{inbuild_dir.name}.cp"
|
|
280
|
-
if cp_file.exists():
|
|
281
|
-
# Read .cp file and adjust paths to be absolute
|
|
282
|
-
with open(cp_file, 'r') as f:
|
|
283
|
-
cp_content = f.read()
|
|
284
|
-
|
|
285
|
-
# Replace relative paths with absolute paths
|
|
286
|
-
# SOURCE(filename.cpp) -> SOURCE(/absolute/path/to/inbuilds/module/filename.cpp)
|
|
287
|
-
# HEADER(filename.h) -> HEADER(/absolute/path/to/inbuilds/module/filename.h)
|
|
288
|
-
import re
|
|
289
|
-
|
|
290
|
-
def replace_path(match):
|
|
291
|
-
"""Replace relative path with absolute."""
|
|
292
|
-
path = match.group(1)
|
|
293
|
-
if not Path(path).is_absolute():
|
|
294
|
-
# Make absolute relative to inbuild directory
|
|
295
|
-
abs_path = str((inbuild_dir / path).resolve())
|
|
296
|
-
# Normalize path separators for cross-platform
|
|
297
|
-
abs_path = abs_path.replace('\\', '/')
|
|
298
|
-
return f'{match.group(0).split("(")[0]}({abs_path})'
|
|
299
|
-
return match.group(0)
|
|
300
|
-
|
|
301
|
-
cp_content = re.sub(r'SOURCE\(([^)]+)\)', replace_path, cp_content)
|
|
302
|
-
cp_content = re.sub(r'HEADER\(([^)]+)\)', replace_path, cp_content)
|
|
303
|
-
|
|
304
|
-
# Write adjusted .cp file
|
|
305
|
-
dest = combined_plugins_dir / cp_file.name
|
|
306
|
-
with open(dest, 'w') as f:
|
|
307
|
-
f.write(cp_content)
|
|
308
|
-
|
|
309
|
-
inbuild_count += 1
|
|
310
|
-
if verbose:
|
|
311
|
-
print(f"Added inbuild plugin: {cp_file.name} (paths adjusted)")
|
|
312
|
-
|
|
313
|
-
total_plugins = len(user_plugins) + inbuild_count
|
|
314
|
-
|
|
315
|
-
if total_plugins == 0:
|
|
316
|
-
raise CppBuildError("No plugins found (neither user nor inbuilt)")
|
|
194
|
+
if len(user_plugins) == 0:
|
|
195
|
+
raise CppBuildError("No plugins found in plugins directory")
|
|
317
196
|
|
|
318
197
|
bindings_cpp = self.bindings_dir / "bindings.cpp"
|
|
319
198
|
sources_txt = self.bindings_dir / "sources.txt"
|
|
320
199
|
|
|
321
|
-
# Run generator on
|
|
200
|
+
# Run generator on plugins directory
|
|
322
201
|
cmd = [
|
|
323
202
|
str(self.gen_exe),
|
|
324
|
-
str(
|
|
203
|
+
str(self.plugins_dir),
|
|
325
204
|
str(bindings_cpp),
|
|
326
205
|
str(sources_txt),
|
|
327
206
|
str(self.registry_file)
|
|
@@ -329,8 +208,8 @@ class BuildManager:
|
|
|
329
208
|
|
|
330
209
|
try:
|
|
331
210
|
if verbose:
|
|
332
|
-
print(f"Running generator on {
|
|
333
|
-
print(f"
|
|
211
|
+
print(f"Running generator on {len(user_plugins)} plugin(s)...")
|
|
212
|
+
print(f" Plugins dir: {self.plugins_dir}")
|
|
334
213
|
print(f" Bindings output: {bindings_cpp}")
|
|
335
214
|
|
|
336
215
|
# Important: Run from project_root so relative paths in .cp files work
|
|
@@ -359,7 +238,7 @@ class BuildManager:
|
|
|
359
238
|
error_msg = f"bindings.cpp not generated: {bindings_cpp}\n"
|
|
360
239
|
error_msg += f"Plugin generator ran successfully but did not create output file.\n"
|
|
361
240
|
error_msg += f"This usually means no .cp files were found or parsed successfully.\n"
|
|
362
|
-
error_msg += f"Total plugins: {
|
|
241
|
+
error_msg += f"Total plugins: {len(user_plugins)}"
|
|
363
242
|
raise CppBuildError(error_msg)
|
|
364
243
|
|
|
365
244
|
if verbose:
|
|
@@ -100,10 +100,6 @@ class CppApi:
|
|
|
100
100
|
self.auto_update = auto_update
|
|
101
101
|
self.silent = False
|
|
102
102
|
|
|
103
|
-
# Detect inbuilds directory (from package installation)
|
|
104
|
-
package_root = Path(__file__).parent.parent
|
|
105
|
-
self.inbuilds_dir = package_root / "inbuilds"
|
|
106
|
-
|
|
107
103
|
if str(self.bindings_dir) not in sys.path:
|
|
108
104
|
sys.path.insert(0, str(self.bindings_dir))
|
|
109
105
|
|
|
@@ -112,19 +108,6 @@ class CppApi:
|
|
|
112
108
|
self.api_module = None
|
|
113
109
|
self._import_api()
|
|
114
110
|
|
|
115
|
-
@property
|
|
116
|
-
def Inbuilds(self):
|
|
117
|
-
"""List of available inbuilt modules."""
|
|
118
|
-
if not self.inbuilds_dir.exists():
|
|
119
|
-
return []
|
|
120
|
-
|
|
121
|
-
inbuilds = []
|
|
122
|
-
for item in self.inbuilds_dir.iterdir():
|
|
123
|
-
if item.is_dir() and (item / f"{item.name}.cp").exists():
|
|
124
|
-
inbuilds.append(item.name)
|
|
125
|
-
|
|
126
|
-
return sorted(inbuilds)
|
|
127
|
-
|
|
128
111
|
def _load_registry(self):
|
|
129
112
|
"""Load module registry (v1.6 or v2.0 format)."""
|
|
130
113
|
if not self.registry_file.exists():
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "IncludeCPP"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.4"
|
|
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.8"
|
|
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="IncludeCPP",
|
|
9
|
-
version="2.3.
|
|
9
|
+
version="2.3.4",
|
|
10
10
|
author="IncludeCPP Team",
|
|
11
11
|
author_email="contact@includecpp.dev",
|
|
12
12
|
description="Professional C++ Python bindings with type-generic templates and native threading",
|
|
@@ -30,9 +30,6 @@ setup(
|
|
|
30
30
|
'templates/*',
|
|
31
31
|
'generator/*.cpp',
|
|
32
32
|
'generator/*.h',
|
|
33
|
-
'inbuilds/*/*.h',
|
|
34
|
-
'inbuilds/*/*.cpp',
|
|
35
|
-
'inbuilds/*/*.cp',
|
|
36
33
|
],
|
|
37
34
|
},
|
|
38
35
|
python_requires='>=3.8',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__all__ = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|