Skip to content

Commit 824ec7d

Browse files
committed
fix: Build change
1 parent 3ccc9f3 commit 824ec7d

5 files changed

Lines changed: 41 additions & 70 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test-local-wheel-build:
2929
# Clean any existing builds
3030
rm -rf build/ dist/
3131
# Download artifacts and place them where they should go
32-
python scripts/download_artifacts.py c2pa-v0.49.5
32+
python scripts/download_artifacts.py c2pa-v0.55.0
3333
# Install Python
3434
python3 -m pip install -r requirements.txt
3535
python3 -m pip install -r requirements-dev.txt
@@ -39,6 +39,11 @@ test-local-wheel-build:
3939
# Verify installation in local venv
4040
python -c "import c2pa; print('C2PA package installed at:', c2pa.__file__)"
4141

42+
verify-wheel-build:
43+
rm -rf build/ dist/ src/*.egg-info/
44+
python -m build
45+
twine check dist/*
46+
4247
publish: release
4348
python3 -m pip install twine
4449
python3 -m twine upload dist/*

deny.toml

Lines changed: 0 additions & 57 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version = "0.10.0"
88
requires-python = ">=3.10"
99
description = "Python bindings for the C2PA Content Authenticity Initiative (CAI) library"
1010
readme = { file = "README.md", content-type = "text/markdown" }
11-
license = { text = "MIT OR Apache-2.0" }
11+
license = "MIT OR Apache-2.0"
1212
authors = [{ name = "Gavin Peacock", email = "gvnpeacock@adobe.com" }]
1313
classifiers = [
1414
"Programming Language :: Python :: 3",
@@ -37,9 +37,3 @@ test = [
3737
[project.scripts]
3838
download-artifacts = "c2pa.build:download_artifacts"
3939

40-
[tool.hatch.build.targets.wheel]
41-
packages = ["src/c2pa"]
42-
43-
[tool.hatch.build.hooks.custom]
44-
path = "c2pa/build.py"
45-

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = 1.0.0
44
description = Python bindings for the C2PA library
55
long_description = file: README.md
66
long_description_content_type = text/markdown
7+
license = MIT OR Apache-2.0
78

89
[options]
910
package_dir =

setup.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def copy_platform_libraries(platform_name, clean_first=False):
130130
def find_available_platforms():
131131
"""Scan the artifacts directory for available platform-specific libraries."""
132132
if not ARTIFACTS_DIR.exists():
133-
raise ValueError(f"Artifacts directory not found: {ARTIFACTS_DIR}")
133+
print(f"Warning: Artifacts directory not found: {ARTIFACTS_DIR}")
134+
return []
134135

135136
available_platforms = []
136137
for platform_name in PLATFORM_FOLDERS.keys():
@@ -139,7 +140,8 @@ def find_available_platforms():
139140
available_platforms.append(platform_name)
140141

141142
if not available_platforms:
142-
raise ValueError("No platform-specific libraries found in artifacts directory")
143+
print("Warning: No platform-specific libraries found in artifacts directory")
144+
return []
143145

144146
return available_platforms
145147

@@ -152,6 +154,28 @@ def find_available_platforms():
152154
# For wheel building
153155
if 'bdist_wheel' in sys.argv:
154156
available_platforms = find_available_platforms()
157+
if not available_platforms:
158+
print("No platform-specific libraries found. Building wheel without platform-specific libraries.")
159+
setup(
160+
name="c2pa-python",
161+
version="0.10.0",
162+
package_dir={"": "src"},
163+
packages=find_packages(where="src"),
164+
include_package_data=True,
165+
package_data={
166+
"c2pa": ["libs/*"], # Include all files in libs directory
167+
},
168+
classifiers=[
169+
"Programming Language :: Python :: 3",
170+
get_platform_classifier(get_current_platform()),
171+
],
172+
python_requires=">=3.10",
173+
long_description=open("README.md").read(),
174+
long_description_content_type="text/markdown",
175+
license="MIT OR Apache-2.0",
176+
)
177+
sys.exit(0)
178+
155179
print(f"Found libraries for platforms: {', '.join(available_platforms)}")
156180

157181
for platform_name in available_platforms:
@@ -168,7 +192,7 @@ def find_available_platforms():
168192
name="c2pa-python",
169193
version="0.10.0",
170194
package_dir={"": "src"},
171-
packages=find_packages(where="src") + ["c2pa.libs"],
195+
packages=find_packages(where="src"),
172196
include_package_data=True,
173197
package_data={
174198
"c2pa": ["libs/*"], # Include all files in libs directory
@@ -177,6 +201,10 @@ def find_available_platforms():
177201
"Programming Language :: Python :: 3",
178202
get_platform_classifier(platform_name),
179203
],
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",
180208
)
181209
finally:
182210
# Clean up by removing the package libs directory
@@ -198,8 +226,8 @@ def find_available_platforms():
198226
"Programming Language :: Python :: 3",
199227
get_platform_classifier(get_current_platform()),
200228
],
201-
# Add sdist-specific configuration
229+
python_requires=">=3.10",
202230
long_description=open("README.md").read(),
203231
long_description_content_type="text/markdown",
204-
python_requires=">=3.7",
232+
license="MIT OR Apache-2.0",
205233
)

0 commit comments

Comments
 (0)