I’m testing a library with multiple versions of Elixir on my CI. One of my dependencies is specified as a range.
{:poison, ">= 3.1.0 and < 5.0.0", optional: true}
Poison 4.0 is compatible with Elixir 1.6+ while Poison 3.1 is compatible with Elixir 1.3+. When my CI attempts to test in an Elixir 1.3 environment it fails because it’s trying to fetch Poison 4.0.
defmodule Plug.MixProject do
use Mix.Project
# ...
def project do
[
# ...
lockfile: lockfile(),
# ...
]
defp lockfile() do
case System.get_env("COWBOY_VERSION") do
"1" <> _ -> "mix-cowboy1.lock"
_ -> "mix.lock"
end
end
end