update example and build
This commit is contained in:
+37
-1
@@ -86,6 +86,30 @@ def build():
|
||||
json_count += 1
|
||||
print(f"Copied {json_count} JSON config files")
|
||||
|
||||
# Create and copy examples folder (as part of the package)
|
||||
examples_dst = pkg_dir / "examples"
|
||||
examples_dst.mkdir(exist_ok=True)
|
||||
|
||||
# Create __init__.py for examples package
|
||||
examples_init = examples_dst / "__init__.py"
|
||||
with open(examples_init, 'w') as f:
|
||||
f.write("# Examples for orisys package\n")
|
||||
|
||||
example_files = [
|
||||
Path("example1_basic_pipeline.py"),
|
||||
Path("example2_two_sensor_pipeline.py"),
|
||||
]
|
||||
|
||||
example_count = 0
|
||||
for example_file in example_files:
|
||||
if example_file.exists():
|
||||
shutil.copy(example_file, examples_dst)
|
||||
example_count += 1
|
||||
print(f"Copied example: {example_file.name}")
|
||||
else:
|
||||
print(f"Warning: Example file not found: {example_file}")
|
||||
print(f"Copied {example_count} example files to orisys/examples/")
|
||||
|
||||
# Create setup.py for packaging
|
||||
setup_py_path = dist_dir / "setup.py"
|
||||
setup_content = f"""
|
||||
@@ -100,12 +124,24 @@ setup(
|
||||
version="{version}",
|
||||
description="Orisys - Optical Tactile Sensor SDK (Nuitka Compiled)",
|
||||
author="Orisys",
|
||||
packages=['orisys'],
|
||||
packages=['orisys', 'orisys.examples'],
|
||||
package_dir={{'': 'wheel_root'}},
|
||||
package_data={{
|
||||
'orisys': ['*.pyd', 'configs/*.json'],
|
||||
'orisys.examples': ['*.py'],
|
||||
}},
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
"numpy>=1.24.4",
|
||||
"opencv-python>=4.10.0.84",
|
||||
"opencv-contrib-python",
|
||||
"scipy>=1.10.1",
|
||||
],
|
||||
extras_require={{
|
||||
"cuda12": ["cupy-cuda12x>=12.3.0"],
|
||||
"cuda13": ["cupy-cuda13x>=13.0.0"],
|
||||
"cuda": ["cupy-cuda12x>=12.3.0"], # For backward compatibility, defaults to CUDA 12.x
|
||||
}},
|
||||
distclass=BinaryDistribution,
|
||||
zip_safe=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user