Skip to content

Commit 623a068

Browse files
Fix build hook to handle editable installs
1 parent 382d385 commit 623a068

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

build.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
class CustomBuildHook(BuildHookInterface):
44
def initialize(self, version, build_data):
55
"""Add agent package if not installing core-only."""
6-
if 'wheel' not in build_data:
7-
return
6+
# Handle both wheel and editable builds
7+
for build_type in ['wheel', 'editable']:
8+
if build_type not in build_data:
9+
continue
810

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
11+
for target in build_data[build_type].get('targets', []):
12+
extras = target.get('options', {}).get('extras', [])
13+
packages = target.get('packages', [])
14+
15+
if 'core' not in extras and 'commit0.optional.agent' not in packages:
16+
packages.append('commit0.optional.agent')
17+
target['packages'] = packages

0 commit comments

Comments
 (0)