Skip to content

Commit 51e918e

Browse files
Improve handling of dependencies (#185)
* Use latest patch version of dependencies * Only include GzipSwift in MLXMNIST
1 parent 2f1928b commit 51e918e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Package.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ let package = Package(
2727
targets: ["StableDiffusion"]),
2828
],
2929
dependencies: [
30-
.package(url: "https://github.com/ml-explore/mlx-swift", from: "0.21.2"),
31-
.package(url: "https://github.com/huggingface/swift-transformers", from: "0.1.13"),
32-
.package(url: "https://github.com/1024jp/GzipSwift", "6.0.1" ... "6.0.1"),
33-
.package(url: "https://github.com/apple/swift-async-algorithms", from: "1.0.0"),
30+
.package(url: "https://github.com/ml-explore/mlx-swift", .upToNextMinor(from: "0.21.2")),
31+
.package(
32+
url: "https://github.com/huggingface/swift-transformers", .upToNextMinor(from: "0.1.13")
33+
),
34+
.package(
35+
url: "https://github.com/apple/swift-async-algorithms", .upToNextMinor(from: "1.0.0")),
3436
],
3537
targets: [
3638
.target(
@@ -140,6 +142,13 @@ let package = Package(
140142
]
141143
)
142144

145+
// Add GzipSwift dependency only when building MLXMNIST
146+
if package.targets.contains(where: { $0.name == "MLXMNIST" }) {
147+
package.dependencies.append(
148+
.package(url: "https://github.com/1024jp/GzipSwift", "6.0.1" ... "6.0.1")
149+
)
150+
}
151+
143152
if Context.environment["MLX_SWIFT_BUILD_DOC"] == "1"
144153
|| Context.environment["SPI_GENERATE_DOCS"] == "1"
145154
{

0 commit comments

Comments
 (0)