kipcole9 / money_sql

Money functions for the serialization of a money data type in Elixir
Other
27 stars 18 forks source link

Dependencie issue with ex_money 5.2 #7

Closed akaibukai closed 4 years ago

akaibukai commented 4 years ago

Hello,

I'm using both ex_money and ex_money_sql. I set the current latest version for both as following:

#mix.exs
defp deps do
  [
    {:ex_money, "~> 5.2"},
    {:ex_money_sql, "~> 1.3"},
    ..
   ]
end

But since this package (ex_money_sql) pull ex_money 5.0 I'm getting an unchecked dependency error:

Unchecked dependencies for environment dev:
* ex_money (Hex package)
  the dependency does not match the requirement "~> 5.2", got "5.0.2"
** (Mix) Can't continue due to errors on dependencies

Is it just a version bumping issue or is ex_money_sql not compatible with the latest ex_money?

I'm interested to install the latest version of ex_money (or at least 5.1) since I'm getting parse errors for string without currencies. I see you talked about this issue and its update here: https://elixirforum.com/t/ex-money-money-with-currency-type/20143/8

NB: I'll try to see if I can fix it on my side and will come back if I managed to do it..

kipcole9 commented 4 years ago

@akaibukai my apologies for a very slow response - somehow I didn't see a notification from Github.

First, they are definitely compatible. To make sure I created a new app and added in mix.exs:

  defp deps do
    [
      {:ex_money_sql, "~> 1.3"},
      {:jason, "~> 1.0"}
    ]
  end

And after mix deps.get I see:

New:
  cldr_utils 2.9.1
  connection 1.0.4
  db_connection 2.2.2
  decimal 1.8.1
  ecto 3.4.5
  ecto_sql 3.4.5
  ex_cldr 2.16.1
  ex_cldr_currencies 2.6.1
  ex_cldr_numbers 2.15.1
  ex_money 5.2.1
  ex_money_sql 1.3.0
  jason 1.2.1
  nimble_parsec 0.6.0
  postgrex 0.15.5
  telemetry 0.4.2

Which definitely shows ex_money 5.2.1 and ex_money_sql 1.3.0 as expected.

I suspect that maybe your issue is related to upgrading and perhaps a simple mix deps.update ex_money would fix this? Alternatively, just remove the dependency for ex_money since ex_money_sql will include it.

Lastly, you can try mix deps.clean ex_money ex_money_sql --unlock followed by mix deps.get.

Let me know if that resolves your issue?

akaibukai commented 4 years ago

Hello Kip,

It's not a problem, you hadn't need to apologize.. And even thanks for your work!

In the meantime I managed to do it in other way (it was an opportunity to try the other gem..)

But I was sure that the problem was happening even with a fresh repo, and I even remember that I deleted the mix.lock file and the _build directory altogether. Also the problem was not occurring when doing mix deps.get but only when doing mix deps.compile.

I tried again now and the problem doesn't occur anymore.. I should have messed up with something but I'm not sure what.. So I'm going back to ex_money in the project I was working on..

So thanks again for your time..