Skip to content

Bump minimum Swift version to 5.7 #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:5.7
//===----------------------------------------------------------------------===//
//
// This source file is part of the AsyncHTTPClient open source project
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,5 @@ AsyncHTTPClient | Minimum Swift Version
`1.5.0 ..< 1.10.0` | 5.2
`1.10.0 ..< 1.13.0` | 5.4
`1.13.0 ..< 1.18.0` | 5.5.2
`1.18.0 ...` | 5.6
`1.18.0 ..< 1.20.0` | 5.6
`1.20.0 ...` | 5.7
11 changes: 0 additions & 11 deletions Sources/AsyncHTTPClient/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,13 @@ public class HTTPClient {
}
}

#if swift(>=5.7)
/// Shuts down the client and `EventLoopGroup` if it was created by the client.
///
/// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``.
@available(*, noasync, message: "syncShutdown() can block indefinitely, prefer shutdown()", renamed: "shutdown()")
public func syncShutdown() throws {
try self.syncShutdown(requiresCleanClose: false)
}
#else
/// Shuts down the client and `EventLoopGroup` if it was created by the client.
///
/// This method blocks the thread indefinitely, prefer using ``shutdown()-96ayw``.
public func syncShutdown() throws {
try self.syncShutdown(requiresCleanClose: false)
}
#endif

/// Shuts down the client and `EventLoopGroup` if it was created by the client.
///
Expand Down Expand Up @@ -921,9 +912,7 @@ extension HTTPClient {
}
}

#if swift(>=5.7)
extension HTTPClient.Configuration: Sendable {}
#endif

extension HTTPClient.EventLoopGroupProvider: Sendable {}
extension HTTPClient.EventLoopPreference: Sendable {}
Expand Down
10 changes: 0 additions & 10 deletions Sources/AsyncHTTPClient/HTTPHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,6 @@ extension HTTPClient {
return self.promise.futureResult
}

#if swift(>=5.7)
/// Waits for execution of this request to complete.
///
/// - returns: The value of ``futureResult`` when it completes.
Expand All @@ -759,15 +758,6 @@ extension HTTPClient {
public func wait() throws -> Response {
return try self.promise.futureResult.wait()
}
#else
/// Waits for execution of this request to complete.
///
/// - returns: The value of ``futureResult`` when it completes.
/// - throws: The error value of ``futureResult`` if it errors.
public func wait() throws -> Response {
return try self.promise.futureResult.wait()
}
#endif

/// Provides the result of this request.
///
Expand Down
2 changes: 0 additions & 2 deletions Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ class HTTPClientRequestTests: XCTestCase {
XCTAssertEqual(body, expectedChunks)
}

#if swift(>=5.7)
func testChunkingSequenceFastPath() async throws {
func makeBytes() -> some Sequence<UInt8> & Sendable {
Array(repeating: 0, count: bagOfBytesToByteBufferConversionChunkSize) +
Expand Down Expand Up @@ -569,7 +568,6 @@ class HTTPClientRequestTests: XCTestCase {

XCTAssertEqual(body, expectedChunks)
}
#endif

func testBodyStringChunking() throws {
let body = try HTTPClient.Body.string(
Expand Down
21 changes: 0 additions & 21 deletions docker/docker-compose.2004.56.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions docker/docker-compose.2204.510.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3"

services:

runtime-setup:
image: async-http-client:22.04-5.10
build:
args:
base_image: "swiftlang/swift:nightly-5.10-jammy"

documentation-check:
image: async-http-client:22.04-5.10

test:
image: async-http-client:22.04-5.10
environment:
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
#- SANITIZER_ARG=--sanitize=thread

shell:
image: async-http-client:22.04-5.10
3 changes: 2 additions & 1 deletion docker/docker-compose.2204.59.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ services:
image: async-http-client:22.04-5.9
build:
args:
base_image: "swiftlang/swift:nightly-5.9-jammy"
ubuntu_version: "jammy"
swift_version: "5.9"

documentation-check:
image: async-http-client:22.04-5.9
Expand Down