Skip to content

Commit b23d0fc

Browse files
committed
Detach Python, again
I have made up my mind to just not use PythonKit to do anything. It makes my life easier.
1 parent 8848280 commit b23d0fc

File tree

5 files changed

+17
-34
lines changed

5 files changed

+17
-34
lines changed

Copilot for Xcode.xcodeproj/project.pbxproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
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 */; };
2927
C861E6112994F6070056CB02 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C861E6102994F6070056CB02 /* AppDelegate.swift */; };
3028
C861E6152994F6080056CB02 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C861E6142994F6080056CB02 /* Assets.xcassets */; };
3129
C861E61E2994F6150056CB02 /* Service in Frameworks */ = {isa = PBXBuildFile; productRef = C861E61D2994F6150056CB02 /* Service */; };
@@ -487,8 +485,6 @@
487485
isa = PBXResourcesBuildPhase;
488486
buildActionMask = 2147483647;
489487
files = (
490-
C861A7AE2A41EF1A006A8698 /* site-packages in Resources */,
491-
C861A7AD2A41EDDF006A8698 /* python-stdlib in Resources */,
492488
C861E6152994F6080056CB02 /* Assets.xcassets in Resources */,
493489
C81291D72994FE6900196E12 /* Main.storyboard in Resources */,
494490
);
@@ -514,7 +510,7 @@
514510
);
515511
runOnlyForDeploymentPostprocessing = 0;
516512
shellPath = /bin/sh;
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";
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";
518514
};
519515
C8A3B1782A2894E10046E809 /* Sign Python Site Packages */ = {
520516
isa = PBXShellScriptBuildPhase;

Copilot for Xcode.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let package = Package(
4949
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.1.0"),
5050
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.0.0"),
5151
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess", from: "4.2.2"),
52-
.package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
52+
// .package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
5353
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.1"),
5454
.package(
5555
url: "https://github.com/pointfreeco/swift-composable-architecture",
@@ -89,11 +89,11 @@ let package = Package(
8989
"UserDefaultsObserver",
9090
"ChatTab",
9191
.product(name: "Logger", package: "Tool"),
92-
.product(name: "PythonHelper", package: "Tool"),
92+
// .product(name: "PythonHelper", package: "Tool"),
9393
.product(name: "OpenAIService", package: "Tool"),
9494
.product(name: "Preferences", package: "Tool"),
9595
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
96-
.product(name: "PythonKit", package: "PythonKit"),
96+
// .product(name: "PythonKit", package: "PythonKit"),
9797
]
9898
),
9999
.testTarget(
@@ -206,7 +206,7 @@ let package = Package(
206206
"Environment",
207207
.product(name: "OpenAIService", package: "Tool"),
208208
.product(name: "Terminal", package: "Tool"),
209-
.product(name: "PythonKit", package: "PythonKit"),
209+
// .product(name: "PythonKit", package: "PythonKit"),
210210
]
211211
),
212212
.target(
@@ -335,7 +335,7 @@ let package = Package(
335335
"ChatPlugin",
336336
.product(name: "OpenAIService", package: "Tool"),
337337
.product(name: "LangChain", package: "Tool"),
338-
.product(name: "PythonKit", package: "PythonKit"),
338+
// .product(name: "PythonKit", package: "PythonKit"),
339339
],
340340
path: "Sources/ChatPlugins/MathChatPlugin"
341341
),

ExtensionService/AppDelegate.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import FileChangeChecker
44
import LaunchAgentManager
55
import Logger
66
import Preferences
7-
import PythonHelper
87
import Service
98
import ServiceManagement
109
import ServiceUpdateMigration
@@ -48,7 +47,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
4847
Task {
4948
do {
5049
try await ServiceUpdateMigrator().migrate()
51-
await initializePython()
5250
} catch {
5351
Logger.service.error(error.localizedDescription)
5452
}

Tool/Package.swift

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ let package = Package(
99
products: [
1010
.library(name: "Terminal", targets: ["Terminal"]),
1111
.library(name: "LangChain", targets: ["LangChain"]),
12-
.library(name: "PythonHelper", targets: ["PythonHelper"]),
12+
// .library(name: "PythonHelper", targets: ["PythonHelper"]),
1313
.library(name: "ExternalServices", targets: ["BingSearchService"]),
1414
.library(name: "Preferences", targets: ["Preferences", "Configs"]),
1515
.library(name: "Logger", targets: ["Logger"]),
1616
.library(name: "OpenAIService", targets: ["OpenAIService"]),
1717
],
1818
dependencies: [
19-
.package(path: "../Python"),
20-
.package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
19+
// .package(path: "../Python"),
20+
// .package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
2121
// A fork of https://github.com/aespinilla/Tiktoken to allow loading from local files.
2222
.package(url: "https://github.com/intitni/Tiktoken", branch: "main"),
2323
.package(url: "https://github.com/apple/swift-async-algorithms", from: "0.1.0"),
@@ -57,8 +57,6 @@ let package = Package(
5757
name: "LangChain",
5858
dependencies: [
5959
"OpenAIService",
60-
"PythonHelper",
61-
.product(name: "PythonKit", package: "PythonKit"),
6260
.product(name: "Parsing", package: "swift-parsing"),
6361
.product(name: "SwiftSoup", package: "SwiftSoup"),
6462
.product(name: "USearch", package: "usearch"),
@@ -67,14 +65,14 @@ let package = Package(
6765

6866
.target(name: "BingSearchService"),
6967

70-
.target(
71-
name: "PythonHelper",
72-
dependencies: [
73-
"Logger",
74-
.product(name: "Python", package: "Python"),
75-
.product(name: "PythonKit", package: "PythonKit"),
76-
]
77-
),
68+
// .target(
69+
// name: "PythonHelper",
70+
// dependencies: [
71+
// "Logger",
72+
// .product(name: "Python", package: "Python"),
73+
// .product(name: "PythonKit", package: "PythonKit"),
74+
// ]
75+
// ),
7876

7977
// MARK: - OpenAI
8078

0 commit comments

Comments
 (0)