Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 2019 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 2019 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 2019 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 2019 17:11

    alexarchambault on master

    1.6.3 (compare)

  • Jan 25 2019 15:48
    alexarchambault commented #923
  • Jan 25 2019 01:15

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 2019 00:50

    alexarchambault on master

    Partly revert 84d48542 (#923) … (compare)

  • Jan 25 2019 00:50
    alexarchambault closed #923
  • Jan 25 2019 00:50
    alexarchambault closed #920
  • Jan 25 2019 00:50
    alexarchambault closed #922
  • Jan 24 2019 23:13
    lihaoyi commented #923
  • Jan 24 2019 22:39
    alexarchambault closed #921
  • Jan 24 2019 22:39
    alexarchambault commented #921
  • Jan 24 2019 22:39
    alexarchambault edited #923
  • Jan 24 2019 22:38
    alexarchambault opened #923
  • Jan 24 2019 22:37
    david-bouyssie commented #919
  • Jan 24 2019 21:33
    nksureshkumar commented #922
Li Haoyi
@lihaoyi
Can you replace fansi.Colors.Reset with fansi.Attrs.Empty
I think the interp.colors.prompt is being applied on top of the repl.prompt and resetting all your colors
Thomas Dickerson
@elfprince13
gotcha
that appears to work =)
Naftoli Gugenheim
@nafg
Is it possible to import a .scala file?
James Kyle
@jameskyle
When I make a change to the build.sbt, I get the error GITHUB REF None fatal: no tag exactly matches 'the ref'. Is there a way to bypass this check?}
James Kyle
@jameskyle
hm, got past that. Trying to figure out how to shade a dependency
James Kyle
@jameskyle

I'm trying to run a spark session in the repl. There's a conflict between the bundled spark version, 2.5, of protobuf and the tertiary dependency pulled in by scalapb of protobuf (3.15). Scalapb says this should be shaded to avoid conflicts with spark.

Not sure how to do this with mill

Naftoli Gugenheim
@nafg
Suppose I want to reuse local bits of code between the SBT build and the mill build, and I don't want to just symlink the same file as .scala and .sc. It occurred to me that it might be possible if Ammonite exposes an API to invoke a method in a script file
That is, suppose I have a Util.sc file like this:
object Util {
  def api(param: Int) = "result"
}
In Mill I can just do import $file.Util; Util.api(7) == "result"
In SBT, perhaps I could access the ammonite script runner as a library, parse Util.sc, and tell it to invoke "Util.api(${7})" somehow?
James Kyle
@jameskyle
Just checking in on any guidance on how to shade a dependency in a ammonite repl build
Zhranklin
@zhranklin
Hi, how to use interp.configureCompiler with scala 3?
Tobias Roeser
@lefou
@lihaoyi / @alexarchambault I'd like to access the input files of a mill build script build.sc which are the build.sc and all the included .sc files and magic imports to make them available via BSP, for a better editing experience. Is there a way to access these info easily?
0xACE
@0xACE
is there a way to get ammonite.ops working from jupyter notebooks?
import ammonite.ops._
ls! pwd
sh: line 1: /dev/tty: No such device or address
java.lang.RuntimeException: Nonzero exit value: 1
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:164)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:121)
Florian Schmaus
@Flowdalic
Is there a way to define a @main method as default method if no other is explicitly selected?
Li Haoyi
@lihaoyi
there isnt, but such a feature coupd be added (assuming positional args are disabled)
Florian Schmaus
@Flowdalic
@lihaoyi I wonder if it couldn't even be added with positional arguments
You simply check if the first argument is a known command, and if not, invoke the default method with the positional arguments shifted by one
Wouldn't that work?
thanks for your work on Ammonite :)
Lorenzo Gabriele
@lolgab
I'm trying to understand how the Scala 3 build works in Ammonite but I'm failing miserably :-D
So, the modules are compiled with Scala 2.13 but use the Scala 3 dependencies?
Because using withDottyCompat or not makes no difference if the module is using supports3 = false.
Is that intended?
For example, this PR made no difference: com-lihaoyi/Ammonite#1224
Since the dependencies chosen are still _2.13 since scalaVersion is 2.13
Is ammonite very special or do we miss in Mill the Scala 2.13 3 that Sbt has? 🤔
Lorenzo Gabriele
@lolgab
From what I'm understanding, Ammonite builds its modules twice, one for Scala 2.13 and one for Scala 3. These two modules are both Scala 2.13 modules with the only difference that one depends on Scala 3 dependencies (when available) and the other is the usual Scala 2.13 module.
Is this correct?
Lorenzo Gabriele
@lolgab
I think what's tricking me is a problem in Mill that doesn't support mixing Scala 3 and Scala 2.13 projects as sbt does.
If a 2.13 project depends on a 3 project all the scala 3 dependencies are automatically converted into _2.13 dependencies in Mill, while they maintain the _3 suffix in Sbt.
Tobias Roeser
@lefou
@lolgab I quickly implemented what I think is needed to fix this issue. I haven't done any tests etc., but if you want to try it have a look at PR com-lihaoyi/mill#1574
If you do, let me know it it works
Csaba Kincses
@kincsescsaba
Hello there! I'm new to Ammonite, and I'm trying to figure out how can I display stdout output continuously. As I see in the docks, chunks are stored, but how can I get these in the case when the program runs for long and it's not enough to only display the output at the end of the run but also before it finished?
Lorenzo Gabriele
@lolgab
@kincsescsaba You could use tee https://stackoverflow.com/a/418899
discobaba
@uncleweirdo_twitter
MainArgs is pretty awesome but I think it would be nice to have an option to have a @main that didn't show up in the help. Or maybe I'm just missing how to do it ...
Lorenzo Gabriele
@lolgab
@uncleweirdo_twitter There is an open issue for that com-lihaoyi/mainargs#4
discobaba
@uncleweirdo_twitter
@lolgab sweet
Siddhant Sanyam
@siddhant3s

this version which got added today has a bug: https://repo.maven.apache.org/maven2/com/lihaoyi/ammonite-repl_2.12.12/2.4.1-6-5f9cddf3/

When running ammonite it says "No main method found in ammonite.Main"

Chris Kipp
@ckipp:matrix.org
[m]
looks like there is a pr to fix this already coursier/apps#125
depending on how you have it installed
Bob Glamm
@glamm
Am I crazy to think that running the REPL with -h /path/to/my/dir should read /path/to/my/dir/predef.sc as the predef file?
Bob Glamm
@glamm
disregard previous, apparently I'm off my medications and have forgotten how to actually save a file from my editor /facepalm
Alexandr
@av-maslov
Hei, i installed ammonite using coursier, and after running amm got error Error: main method not found in class ammonite.Main. How to fix this? Please help
ykpcx
@Runky-op
can I use scala3 in ammonite? I am using ammonite 2.4.1, and its default scala version is 2.13.7.
Lorenzo Gabriele
@lolgab
@Runky-op You need to download specifically the Scala 3 version. Check the Github releases.
Chris Kipp
@ckipp:matrix.org
[m]
you're hitting on this @av-maslov coursier/apps#125
coursier installs the latest release, and the main method changed, but the coursier app wasn't updated yet to reflect it
Olav Grøndal
@ogroendal
I have added the following to my sbt:
libraryDependencies += "com.lihaoyi" % "ammonite" % "2.4.1" % "test" cross CrossVersion.full sourceGenerators in Test += Def.task { val file = (sourceManaged in Test).value / "amm.scala" IO.write(file, """object amm extends App { ammonite.AmmoniteMain.main(args) }""") Seq(file) }.taskValue
But when I try to run sbt and then type the command - test:runMain amm I am told that "object AmmoniteMain is not a member of package ammonite". I assume I did something dumb here, but cant see what
The test scala file is generated, but the code dont work
I wanted to try and run some code from the another sbt project in the scala repl, and I tried to follow the website instructions for doing that