Re: [elixir-core:11321] elixirc_paths and deps including test libs separate from prod builds

2023-03-17 Thread José Valim
Yes, even another library. You can run it in test while you are in test.

And the error message says it must be a relative path pointing inside the
current directory, IIRC.

On Fri, Mar 17, 2023 at 20:26 Brandon Gillespie  wrote:

> On 3/16/23 5:00 PM, José Valim wrote:
>
> > You shouldn't need to bundle test code into your production code.
> >
> > 1. Deps are compiled in prod but in_umbrella deps are compiled in the
> > same environment as the current project. You can achieve this by
> > specifying the env option to the dependency, such as "env: Mix.env()",
> > and it works for any dependency
>
>
> Even when this is a library? So "your production code" becomes muddied.
> I create a library, I post it to hex.pm, then another app uses this
> library—how can it use the library's ex_machina test factories?
>
>
> > > So I'm not sure why it effectively said "this thing I'm holding
> > doesn't exist."
> >
> > That's now what it says. It says that it must be either relative from
> > the current dir or absolute to anywhere. :)
>
>
> But it is relative and that's my confusion :)
>
> I gave it the path "../../deps/rivet_ident/test/lib" and it found the
> actual factory, it then gave the absolute path to that factory as part
> of the error, and the absolute path was correct, yet it said it couldn't
> use it. This is what confused me.
>
>
> -Brandon
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/0e3006c8-aa9e-c360-ad37-16374554ab7a%40cold.org
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2B%2BYiTSNiaytuBkJNyiFnfo%2BPiVs5-BRkPaj0Cx6DvKpg%40mail.gmail.com.


Re: [elixir-core:11320] elixirc_paths and deps including test libs separate from prod builds

2023-03-17 Thread Brandon Gillespie

On 3/16/23 5:00 PM, José Valim wrote:


You shouldn't need to bundle test code into your production code.

1. Deps are compiled in prod but in_umbrella deps are compiled in the 
same environment as the current project. You can achieve this by 
specifying the env option to the dependency, such as "env: Mix.env()", 
and it works for any dependency



Even when this is a library? So "your production code" becomes muddied. 
I create a library, I post it to hex.pm, then another app uses this 
library—how can it use the library's ex_machina test factories?



> So I'm not sure why it effectively said "this thing I'm holding 
doesn't exist."


That's now what it says. It says that it must be either relative from 
the current dir or absolute to anywhere. :)



But it is relative and that's my confusion :)

I gave it the path "../../deps/rivet_ident/test/lib" and it found the 
actual factory, it then gave the absolute path to that factory as part 
of the error, and the absolute path was correct, yet it said it couldn't 
use it. This is what confused me.



-Brandon

--
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/0e3006c8-aa9e-c360-ad37-16374554ab7a%40cold.org.


[elixir-core:11320] mix deps.sync

2023-03-17 Thread 'Neil Lyons' via elixir-lang-core
I removed a dependency from `deps/0` in  `mix.exs` and realised that it 
didn't remove it from the lock file.

Is `mix deps.clean --unlock --unused` the correct way to fully remove a 
dependency [0]?

If so I was thinking most developers probably don't realise this. Perhaps a 
new alias could be added called `deps.sync` that you run after 
adding/removing dependencies 樂

eg.

"deps.sync": ["deps.get", "mix deps.clean --unlock --unused"]

[0]: 
https://til.hashrocket.com/posts/biytzjjppd-how-to-remove-unused-deps-from-mixlock

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/618b8a50-c9da-47dc-9acf-31b78deecc83n%40googlegroups.com.