Skip to content

Commit b6d5fcc

Browse files
committed
fix: Build debug
1 parent 64bb070 commit b6d5fcc

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

setup.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -182,24 +182,27 @@ def find_available_platforms():
182182
print("Installing in development mode for platform ", current_platform)
183183
copy_platform_libraries(current_platform)
184184

185-
# Standard setup call
186-
# For release builds using 'python -m build', libraries should be copied
187-
# beforehand in the CI workflow
188-
setup(
189-
name=PACKAGE_NAME,
190-
version=VERSION,
191-
package_dir={"": "src"},
192-
packages=find_namespace_packages(where="src"),
193-
include_package_data=True,
194-
package_data={
195-
"c2pa": ["libs/*"], # Include all files in libs directory
196-
},
197-
classifiers=[
198-
"Programming Language :: Python :: 3",
199-
get_platform_classifier(get_current_platform()),
200-
],
201-
python_requires=">=3.10",
202-
long_description=open("README.md").read(),
203-
long_description_content_type="text/markdown",
204-
license="MIT OR Apache-2.0",
205-
)
185+
# Only call setup() if we're being executed as a script (not imported)
186+
# This allows importing helper functions without triggering setup
187+
if __name__ == "__main__" or "setuptools.build_meta" in sys.modules:
188+
# Standard setup call
189+
# For release builds using 'python -m build', libraries should be copied
190+
# beforehand in the CI workflow
191+
setup(
192+
name=PACKAGE_NAME,
193+
version=VERSION,
194+
package_dir={"": "src"},
195+
packages=find_namespace_packages(where="src"),
196+
include_package_data=True,
197+
package_data={
198+
"c2pa": ["libs/*"], # Include all files in libs directory
199+
},
200+
classifiers=[
201+
"Programming Language :: Python :: 3",
202+
get_platform_classifier(get_current_platform()),
203+
],
204+
python_requires=">=3.10",
205+
long_description=open("README.md").read(),
206+
long_description_content_type="text/markdown",
207+
license="MIT OR Apache-2.0",
208+
)

0 commit comments

Comments
 (0)