Skip to content

Commit da8d776

Browse files
committed
Setup Python
1 parent c322eb9 commit da8d776

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Copilot for Xcode.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
C8216B802980378300AD38C7 /* Helper in Embed XPCService */ = {isa = PBXBuildFile; fileRef = C8216B70298036EC00AD38C7 /* Helper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
2525
C8520301293C4D9000460097 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8520300293C4D9000460097 /* Helpers.swift */; };
2626
C861A6A329E5503F005C41A3 /* PromptToCodeCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C861A6A229E5503F005C41A3 /* PromptToCodeCommand.swift */; };
27+
C861A7AD2A41EDDF006A8698 /* python-stdlib in Resources */ = {isa = PBXBuildFile; fileRef = C83E5DEA2A38CD000071506D /* python-stdlib */; };
28+
C861A7AE2A41EF1A006A8698 /* site-packages in Resources */ = {isa = PBXBuildFile; fileRef = C83E5DE92A38CD000071506D /* site-packages */; };
2729
C861E6112994F6070056CB02 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C861E6102994F6070056CB02 /* AppDelegate.swift */; };
2830
C861E6152994F6080056CB02 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C861E6142994F6080056CB02 /* Assets.xcassets */; };
2931
C861E61E2994F6150056CB02 /* Service in Frameworks */ = {isa = PBXBuildFile; productRef = C861E61D2994F6150056CB02 /* Service */; };
@@ -485,6 +487,8 @@
485487
isa = PBXResourcesBuildPhase;
486488
buildActionMask = 2147483647;
487489
files = (
490+
C861A7AE2A41EF1A006A8698 /* site-packages in Resources */,
491+
C861A7AD2A41EDDF006A8698 /* python-stdlib in Resources */,
488492
C861E6152994F6080056CB02 /* Assets.xcassets in Resources */,
489493
C81291D72994FE6900196E12 /* Main.storyboard in Resources */,
490494
);
@@ -510,7 +514,7 @@
510514
);
511515
runOnlyForDeploymentPostprocessing = 0;
512516
shellPath = /bin/sh;
513-
shellScript = "#set -e\n#echo \"Signing as $EXPANDED_CODE_SIGN_IDENTITY_NAME ($EXPANDED_CODE_SIGN_IDENTITY)\"\n#find \"$CODESIGNING_FOLDER_PATH/Contents/Resources/python-stdlib/lib-dynload\" -name \"*.so\" -exec /usr/bin/codesign --force --sign \"$EXPANDED_CODE_SIGN_IDENTITY\" -o runtime --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der {} \\;\n";
517+
shellScript = "set -e\necho \"Signing as $EXPANDED_CODE_SIGN_IDENTITY_NAME ($EXPANDED_CODE_SIGN_IDENTITY)\"\nfind \"$CODESIGNING_FOLDER_PATH/Contents/Resources/python-stdlib/lib-dynload\" -name \"*.so\" -exec /usr/bin/codesign --force --sign \"$EXPANDED_CODE_SIGN_IDENTITY\" -o runtime --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der {} \\;\n";
514518
};
515519
C8A3B1782A2894E10046E809 /* Sign Python Site Packages */ = {
516520
isa = PBXShellScriptBuildPhase;

Core/Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ let package = Package(
8080
"SuggestionWidget",
8181
"AXExtension",
8282
"ChatService",
83-
.product(name: "Logger", package: "Tool"),
8483
"PromptToCodeService",
8584
"ServiceUpdateMigration",
8685
"UserDefaultsObserver",
86+
.product(name: "Logger", package: "Tool"),
87+
.product(name: "PythonHelper", package: "Tool"),
8788
.product(name: "OpenAIService", package: "Tool"),
8889
.product(name: "Preferences", package: "Tool"),
8990
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),

ExtensionService/AppDelegate.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import FileChangeChecker
44
import LaunchAgentManager
55
import Logger
66
import Preferences
7+
import PythonHelper
78
import Service
89
import ServiceManagement
910
import ServiceUpdateMigration
@@ -43,10 +44,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
4344
NSApp.setActivationPolicy(.accessory)
4445
buildStatusBarMenu()
4546
DependencyUpdater().update()
46-
47+
4748
Task {
4849
do {
4950
try await ServiceUpdateMigrator().migrate()
51+
await initializePython()
5052
} catch {
5153
Logger.service.error(error.localizedDescription)
5254
}

0 commit comments

Comments
 (0)