From e6d3c6cf69c71ea1a5610831eb132e07f7b95a8f Mon Sep 17 00:00:00 2001 From: Awea Date: Tue, 6 Feb 2024 11:33:49 +0100 Subject: [PATCH 1/2] Fix deprecated File.stream!(file, options, line_or_bytes) See https://hexdocs.pm/elixir/1.16.1/changelog.html#3-soft-deprecations-no-warnings-emitted --- .tool-versions | 4 ++-- lib/multipart/part.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.tool-versions b/.tool-versions index 73654c1..53ee0b1 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.14.0-otp-25 -erlang 25.0.4 +elixir 1.16.1-otp-26 +erlang 26.2.1 diff --git a/lib/multipart/part.ex b/lib/multipart/part.ex index 75a3aad..43859fd 100644 --- a/lib/multipart/part.ex +++ b/lib/multipart/part.ex @@ -35,7 +35,7 @@ defmodule Multipart.Part do @spec file_body(String.t(), headers()) :: t() def file_body(path, headers \\ []) do %File.Stat{size: size} = File.stat!(path) - file_stream = File.stream!(path, [{:read_ahead, 4096}], 1024) + file_stream = File.stream!(path, 1024, [{:read_ahead, 4096}]) %__MODULE__{body: file_stream, content_length: size, headers: headers} end From 9e6e72f2dbcf3f2d3c19ea3eae9b9c8a8595b157 Mon Sep 17 00:00:00 2001 From: Awea Date: Tue, 6 Feb 2024 11:41:47 +0100 Subject: [PATCH 2/2] Drop support for Elixir versions < 1.16 --- .github/workflows/test.yml | 8 ++------ mix.exs | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc24bea..6b1b016 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,13 +7,9 @@ jobs: strategy: matrix: include: - - elixir: 1.14.x - otp: 25.x + - elixir: 1.16.x + otp: 26.x check_formatted: true - - elixir: 1.13.x - otp: 24.x - - elixir: 1.12.x - otp: 24.x steps: - uses: actions/checkout@v2 diff --git a/mix.exs b/mix.exs index 2e411a3..9a5866c 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,7 @@ defmodule Multipart.MixProject do [ app: :multipart, version: @version, - elixir: "~> 1.12", + elixir: "~> 1.16", name: "Multipart", source_url: "https://github.com/breakroom/multipart", description: "Multipart message generator",