Skip to content

Commit 88c0419

Browse files
authored
Merge pull request #76 from Quafadas/mill1
mill1
2 parents d4643c9 + fd0b3b9 commit 88c0419

39 files changed

+400
-200
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"ghcr.io/guiyomh/features/just:0" :{}
2727
},
2828
// Use 'forwardPorts' to make a list of ports inside the container available locally.
29-
// "forwardPorts": [],
29+
"forwardPorts": [8080],
3030
// Use 'postCreateCommand' to run commands after the container is created.
31-
"postCreateCommand": "chmod +x mill"
31+
"postCreateCommand": ""
3232
// Configure tool-specific properties.
3333
// "customizations": {},
3434
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
This is a scala 3 project using the mill build tool. It is a lightweight dataframe library with the twist that it expects the "dataframe" in question to have it's structure identified by the compiler, at compile time. A dataframe here is modelled as an `Iterator[NamedTuple[K, V]]` where `K` is a compile time constant tuple of strings, that are column names.
2-
3-
When writing tests, use scala munit. Cross platform tests should be in 'scautable/test/src'.
4-
5-
When writing code, follow the coding guidelines in `styleguide.md` in the root of the repository.
6-
1+
This is a scala 3 project using the mill build tool. It is a lightweight dataframe library with the twist that it expects the "dataframe" in question to have it's structure identified by the compiler, at compile time. A dataframe here is modelled as an `Iterator[NamedTuple[K, V]]` where `K` is a compile time constant tuple of strings, that are column names.
2+
3+
When writing tests, use scala munit. Cross platform tests should be in 'scautable/test/src'.
4+
5+
When writing code, follow the coding guidelines in `styleguide.md` in the root of the repository.
6+
77
Answer all questions in the style of a friendly colleague that is an expert in dataframe libraries, scala3 and the requirements of a statistical library. Feel free to suggest popular API's from successful libraries, e.g. Pandas which expose clean APIs and clear functionality to a consumer of this library.

.github/workflows/ci.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "v*"
88
pull_request:
99
branches:
10-
- main
10+
- "*"
1111

1212
permissions:
1313
id-token: write
@@ -47,17 +47,12 @@ jobs:
4747
- uses: actions/setup-java@main
4848
with:
4949
distribution: 'temurin'
50-
java-version: 17
51-
- name: Setup GPG secrets
52-
run: |
53-
gpg --version
54-
cat <(echo "${{ secrets.PUBLISH_SECRET_KEY }}") | base64 --decode | gpg --batch --import
55-
gpg --list-secret-keys --keyid-format LONG
50+
java-version: 21
5651
- name: Publish to Maven Central
57-
run: ./mill --import "ivy:com.lihaoyi::mill-contrib-sonatypecentral:" mill.contrib.sonatypecentral.SonatypeCentralPublishModule/publishAll --publishArtifacts __.publishArtifacts
52+
run: ./mill mill.javalib.SonatypeCentralPublishModule/
5853
env:
59-
MILL_PGP_PASSPHRASE: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
60-
MILL_PGP_SECRET_BASE64: ${{ secrets.PUBLISH_SECRET_KEY }}
54+
MILL_PGP_PASSPHRASE: ${{ secrets.MILL_PGP_PASSPHRASE }}
55+
MILL_PGP_SECRET_BASE64: ${{ secrets.MILL_PGP_SECRET_BASE64 }}
6156
MILL_SONATYPE_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
6257
MILL_SONATYPE_USERNAME: ${{ secrets.PUBLISH_USER }}
6358

@@ -69,34 +64,34 @@ jobs:
6964
steps:
7065
- uses: actions/setup-java@v4
7166
with:
72-
java-version: 17
67+
java-version: 21
7368
distribution: 'temurin'
7469
- uses: actions/checkout@main
7570
with:
7671
fetch-depth: 0
7772
fetch-tags: true
78-
- run: ./mill site.publishDocs
73+
- run: ./mill site.siteGen
7974

8075
site:
81-
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
76+
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
8277
needs: test
8378
runs-on: ubuntu-latest
8479
steps:
8580
- uses: actions/setup-java@v4
8681
with:
87-
java-version: 17
82+
java-version: 21
8883
distribution: 'temurin'
8984
- uses: actions/checkout@main
9085
with:
9186
fetch-depth: 0
9287
fetch-tags: true
93-
- run: ./mill site.publishDocs
88+
- run: ./mill site.siteGen
9489
- name: Setup Pages
9590
uses: actions/configure-pages@main
9691
- uses: actions/upload-artifact@main
9792
with:
9893
name: page
99-
path: out/site/publishDocs.dest
94+
path: out/site/laika/generateSite.dest
10095
if-no-files-found: error
10196

10297
deploy:

.mill-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"type": "scala",
99
"request": "launch",
1010
"name": "test",
11-
"buildTarget": "scautable.jvm.test",
12-
"testClass": "io.github.quafadas.scautable.CSVSuite",
11+
"buildTarget": "scautable.test.jvm",
12+
"testClass": "io.github.quafadas.scautable.TypeInferrerSuite",
1313
"args": [
1414
"-oD"
1515
]

build.mill

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
package build
1+
//| mill-version: 1.0.4
2+
//| mill-jvm-version: 21
3+
//| mvnDeps:
4+
//| - io.github.quafadas:millSite_mill1_3.7:0.0.50
25

3-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
6+
package build
47

58
import mill._, mill.scalalib._, mill.scalajslib._
69
import mill._, scalalib._, publish._
710

8-
import de.tobiasroeser.mill.vcs.version._
9-
10-
import $packages._
11+
import mill.util.VcsVersion
1112

1213
object Config {
13-
val oslib = ivy"com.lihaoyi::os-lib:0.11.5"
14-
val scalatags = ivy"com.lihaoyi::scalatags::0.13.1"
15-
val fansi = ivy"com.lihaoyi::fansi::0.5.1"
14+
val oslib = mvn"com.lihaoyi::os-lib:0.11.5"
15+
val scalatags = mvn"com.lihaoyi::scalatags::0.13.1"
16+
val fansi = mvn"com.lihaoyi::fansi::0.5.1"
1617

1718

1819

19-
val laminar = ivy"com.raquo::laminar::17.2.1"
20-
val munit = ivy"org.scalameta::munit::1.1.1"
20+
val laminar = mvn"com.raquo::laminar::17.2.1"
21+
val munit = mvn"org.scalameta::munit::1.1.1"
2122
val scalaVersion = "3.7.2"
2223
val scalaJSVersion = "1.19.0"
2324
}
2425

25-
// mill --import ivy:com.lihaoyi::mill-contrib-bloop: mill.contrib.bloop.Bloop/install
26+
// mill __.compiledClassesAndSemanticDbFiles
2627
trait Common extends ScalaModule {
2728
def scalaVersion = Config.scalaVersion
2829

29-
override def ivyDeps = super.ivyDeps() ++ Agg(
30+
override def mvnDeps = super.mvnDeps() ++ Seq(
3031
Config.scalatags,
3132
Config.oslib,
3233
Config.fansi
@@ -37,9 +38,9 @@ trait Common extends ScalaModule {
3738

3839
trait CommonJS extends Common with ScalaJSModule {
3940
def scalaJSVersion = "1.19.0"
40-
override def ivyDeps = super.ivyDeps() ++ Agg(
41-
ivy"org.scala-js::scalajs-dom::2.8.1",
42-
ivy"org.scala-js::scalajs-java-securerandom::1.0.0".withDottyCompat(scalaVersion()),
41+
override def mvnDeps = super.mvnDeps() ++ Seq(
42+
mvn"org.scala-js::scalajs-dom::2.8.1",
43+
mvn"org.scala-js::scalajs-java-securerandom::1.0.0".withDottyCompat(scalaVersion()),
4344
Config.laminar
4445
)
4546
}
@@ -48,9 +49,9 @@ trait CommonJS extends Common with ScalaJSModule {
4849
trait PublishModule extends mill.scalalib.PublishModule {
4950
override def artifactName = "scautable"
5051

51-
override def publishVersion = T{ VcsVersion.vcsState().format() }
52+
override def publishVersion = Task{ VcsVersion.vcsState().format() }
5253

53-
override def pomSettings = T {
54+
override def pomSettings = Task {
5455
PomSettings(
5556
description = "Automatically generate html tables from scala case classes",
5657
organization = "io.github.quafadas",
@@ -68,7 +69,7 @@ trait PublishModule extends mill.scalalib.PublishModule {
6869
trait CommonTests extends TestModule.Munit {
6970

7071
// override def testFramework = "munit.runner.Framework"
71-
override def ivyDeps = super.ivyDeps() ++ Agg(
72+
override def mvnDeps = super.mvnDeps() ++ Seq(
7273
Config.munit
7374
)
7475
}

examples/package.mill

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import mill._, scalalib._, mill.scalajslib._, mill.scalajslib.api._
44

55
import build.Config
66

7-
object `package` extends RootModule with ScalaModule with build.ShareCompileResources {
7+
object `package` extends ScalaModule with build.ShareCompileResources {
88
def scalaVersion = Config.scalaVersion
99
override def moduleDeps = Seq(build.scautable.jvm)
1010

11-
override def ivyDeps = super.ivyDeps() ++ Agg(
12-
ivy"io.github.quafadas::dedav4s::0.10.0-RC2"
11+
override def mvnDeps = super.mvnDeps() ++ Seq(
12+
mvn"io.github.quafadas::dedav4s::0.10.0-RC2"
1313
)
1414

1515
/**

scautable/package.mill

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import mill.scalajslib._
66
import mill.scalajslib.api._
77
import build.Config
88

9-
object `package` extends RootModule {
9+
object `package` extends Module {
1010

1111
trait SharedModule extends build.Common with PlatformScalaModule
1212

1313
trait SharedTest extends SharedModule with TestModule.Munit with build.CommonTests
1414

1515

1616
object jvm extends SharedModule with ScalaModule with build.PublishModule {
17-
override def ivyDeps= super.ivyDeps() ++ Agg(
18-
ivy"org.apache.poi:poi:5.4.1",
19-
ivy"org.apache.poi:poi-ooxml:5.4.1",
17+
override def mvnDeps= super.mvnDeps() ++ Seq(
18+
mvn"org.apache.poi:poi:5.4.1",
19+
mvn"org.apache.poi:poi-ooxml:5.4.1",
2020
)
2121
}
2222

scautable/src-js/jsSpecific.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.github.quafadas.scautable
22

3-
trait PlatformSpecific:
3+
private[scautable] trait PlatformSpecific:
44

55
/** With scaladoc
66
*/

scautable/src-jvm/jvmSpecific.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package io.github.quafadas.scautable
22

33
import java.awt.Desktop
4-
import io.github.quafadas.scautable.scautable.HtmlTableRender
4+
55
import NamedTuple.*
66
// import almond.api.JupyterApi
77
// import almond.interpreter.api.DisplayData
88
// import almond.api.JupyterAPIHolder.value
99

10-
trait PlatformSpecific:
10+
private[scautable] trait PlatformSpecific:
1111

1212
private def openBrowserWindow(uri: java.net.URI): Unit =
1313
if Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE) then Desktop.getDesktop().browse(uri)
@@ -32,9 +32,9 @@ trait PlatformSpecific:
3232
runtime.exec(Array[String](s"""xdg-open $uri]"""))
3333

3434
inline def desktopShowNt[K <: Tuple, V <: Tuple](a: Seq[NamedTuple[K, V]])(using
35-
tableDeriveInstance: HtmlTableRender[V]
35+
tableDeriveInstance: HtmlRenderer.HtmlTableRender[V]
3636
): os.Path =
37-
val asString = scautable.nt(a).toString()
37+
val asString = HtmlRenderer.nt(a).toString()
3838
val theHtml = raw"""
3939
<!DOCTYPE html>
4040
<html>
@@ -70,8 +70,8 @@ $$(document).ready( function () {
7070
* \- summon a HtmlTableRender instance for the case class
7171
* @return
7272
*/
73-
inline def desktopShow[A <: Product](a: Seq[A])(using tableDeriveInstance: HtmlTableRender[A]) =
74-
val asString = scautable(a).toString()
73+
inline def desktopShow[A <: Product](a: Seq[A])(using tableDeriveInstance: HtmlRenderer.HtmlTableRender[A]) =
74+
val asString = HtmlRenderer(a).toString()
7575
val theHtml = raw"""
7676
<!DOCTYPE html>
7777
<html>
@@ -101,6 +101,6 @@ $$(document).ready( function () {
101101

102102
// def almondShow[A <: Product](a: Seq[A])(using tableDeriveInstance: HtmlTableRender[A]) =
103103
// val kernel = summon[JupyterApi]
104-
// val asString = scautable(a).toString()
104+
// val asString = HtmlRenderer(a).toString()
105105
// kernel.publish.html(asString)
106106
end PlatformSpecific

0 commit comments

Comments
 (0)