Skip to content

Commit 382d385

Browse files
Fix build hook to handle missing wheel data
1 parent 2d20677 commit 382d385

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

build.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
class CustomBuildHook(BuildHookInterface):
44
def initialize(self, version, build_data):
55
"""Add agent package if not installing core-only."""
6-
target = build_data['wheel']['targets'][0]
7-
extras = target.get('options', {}).get('extras', [])
8-
9-
if 'core' not in extras:
10-
target['packages'].append('commit0.optional.agent')
6+
if 'wheel' not in build_data:
7+
return
8+
9+
for target in build_data.get('wheel', {}).get('targets', []):
10+
extras = target.get('options', {}).get('extras', [])
11+
packages = target.get('packages', [])
12+
13+
if 'core' not in extras and 'commit0.optional.agent' not in packages:
14+
packages.append('commit0.optional.agent')
15+
target['packages'] = packages

commit0/commit0

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit a853f8168dc8187eebbd788c8fc4a4137644f74b

0 commit comments

Comments
 (0)