Skip to content
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

@version undefined in mix.exs #45

Closed
frpaulas opened this issue Apr 1, 2016 · 10 comments
Closed

@version undefined in mix.exs #45

frpaulas opened this issue Apr 1, 2016 · 10 comments

Comments

@frpaulas
Copy link

frpaulas commented Apr 1, 2016

Shouldn't @version be defined in mix.exs. ?
It's been throwing

mix.exs:12: warning: undefined module attribute @Version, please remove access to @Version or explicitly set it before access

Thanks for the help
paul

@jjh42
Copy link
Owner

jjh42 commented Apr 2, 2016

version is defined in mix.exs as far as I can tell. How exactly are you getting this error?

@frpaulas
Copy link
Author

frpaulas commented Apr 2, 2016

here's the mix.exs file: https://gist.github.com/frpaulas/771d87084bad800a56442f4360467556

I would get the warning message when ever I did iex -S mix

@jjh42
Copy link
Owner

jjh42 commented Apr 2, 2016

Oh I think you see that warning because you haven't specified a version of
mock as you have for the other dependencies.

Mock is published on hex so you can just depend on it that way rather than
directly from github if that's easier.
On Apr 2, 2016 11:34 PM, "Paul Sutcliffe" notifications@github.com wrote:

here's the mix.exs file:
https://gist.github.com/frpaulas/771d87084bad800a56442f4360467556

I would get the warning message when ever I did iex -S mix


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#45 (comment)

@scohen
Copy link

scohen commented May 6, 2016

What if the dependency is in a downstream project that we can't fix? Can you instead check to see if the version is there before relying on it?

I haven't seen similar behavior in other libraries when downloaded from github.

@pguillory
Copy link

Tried depending on mock via hex, but I still see the warning. Anyway, seems like a package should not emit warnings depending on how the dependency is expressed.

If you look at similar usage of @Version in mix.exs files, you'll notice that @Version is defined near the top. See:

You need to do that.

@jjh42
Copy link
Owner

jjh42 commented Jun 12, 2016

Thanks. Its kinda strange because the mix documentation doesn't mention anything about this (https://hex.pm/docs/publish) but i agree a lot of packages seem to do this. Anyway I've pushed a version that has this.

@jjh42
Copy link
Owner

jjh42 commented Jun 12, 2016

Let me know if it resolves it and I'll close the ticket.

@styx
Copy link
Contributor

styx commented Jul 5, 2016

I'm on mock 0.1.3 and still see the warning. I think you should have something like this:

defmodule Mock.Mixfile do
  use Mix.Project

  @version "0.1.3"

  def project do
    [app: :mock,
     version: @version,
  ...
end

@marcisme
Copy link

marcisme commented Aug 1, 2016

@jjh42 It looks like 0.1.4 has not been published yet. The latest version available via hex is still 0.1.3.

@jjh42
Copy link
Owner

jjh42 commented Sep 14, 2016

I've published an updated version to hex. Please let me know if you still have problems.

@jjh42 jjh42 closed this as completed Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants