Skip to content

Commit 77c0d7d

Browse files
committed
feat: re-export core modules so we don't break people
1 parent ccd2ad8 commit 77c0d7d

7 files changed

Lines changed: 116 additions & 8 deletions

File tree

app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ ensureBoilerplate projectFile cabalFile mainFile = do
108108
, " main-is: Main.hs"
109109
, " hs-source-dirs: ."
110110
, " default-language: Haskell2010"
111-
, " build-depends: base, dataframe, text, time, random"
111+
, " build-depends: base, dataframe, text, time, random, dataframe-core, dataframe-operations, dataframe-csv, dataframe-parquet, dataframe-json, dataframe-th, dataframe-csv-th, dataframe-parquet-th, dataframe-viz, dataframe-lazy, dataframe-parsing"
112112
]
113113

114114
writeIfMissing

dataframe-arrow/dataframe-arrow.cabal

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,28 @@ common warnings
3030
-Wunused-local-binds
3131
-Wunused-packages
3232

33+
-- Mirror the meta-package's opt-out flags so the foreign library disappears
34+
-- in lockstep with `dataframe:arrow-bridge`, which sets `buildable: False`
35+
-- under the same conditions. Pass the matching flag to dataframe-arrow
36+
-- (e.g. `--constraint="dataframe-arrow +no-csv"`) when building the meta
37+
-- package with `--flags="no-csv"` against the full cabal.project.
38+
flag no-csv
39+
default: False
40+
manual: True
41+
description: Skip building dataframe-arrow when the meta package's
42+
CSV backend is disabled (arrow-bridge becomes unbuildable).
43+
44+
flag no-parquet
45+
default: False
46+
manual: True
47+
description: Skip building dataframe-arrow when the meta package's
48+
Parquet backend is disabled (arrow-bridge becomes
49+
unbuildable).
50+
3351
foreign-library dataframe-arrow
3452
import: warnings
53+
if flag(no-csv) || flag(no-parquet)
54+
buildable: False
3555
type: native-shared
3656
hs-source-dirs: ffi-export
3757
other-modules: DataFrame.FFI

dataframe-core/src/DataFrame/Internal/Hash.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ import Data.Char (ord)
2222
import qualified Data.Text as T
2323
import Data.Word (Word64)
2424

25-
-- | FNV-1a 64-bit offset basis (used as the initial accumulator).
26-
-- The literal is unsigned and exceeds 'Int' range, so we round-trip through
27-
-- 'Word64' to get the well-defined two's-complement bit pattern.
25+
{- | FNV-1a 64-bit offset basis (used as the initial accumulator).
26+
The literal is unsigned and exceeds 'Int' range, so we round-trip through
27+
'Word64' to get the well-defined two's-complement bit pattern.
28+
-}
2829
fnvOffset :: Int
2930
fnvOffset = fromIntegral (0xcbf29ce484222325 :: Word64)
3031

dataframe-fusion/dataframe-fusion.cabal

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,28 @@ common warnings
4040
-Wunused-local-binds
4141
-Wunused-packages
4242

43+
-- Mirror the meta-package's opt-out flags. dataframe-fusion depends on
44+
-- `dataframe:arrow-bridge`, which sets `buildable: False` when either CSV
45+
-- or Parquet is disabled, so the library has to disappear in lockstep.
46+
-- Pass the matching flag (e.g. `--constraint="dataframe-fusion +no-csv"`)
47+
-- when building the meta package with `--flags="no-csv"` against the full
48+
-- cabal.project.
49+
flag no-csv
50+
default: False
51+
manual: True
52+
description: Skip building dataframe-fusion when the meta package's
53+
CSV backend is disabled.
54+
55+
flag no-parquet
56+
default: False
57+
manual: True
58+
description: Skip building dataframe-fusion when the meta package's
59+
Parquet backend is disabled.
60+
4361
library
4462
import: warnings
63+
if flag(no-csv) || flag(no-parquet)
64+
buildable: False
4565
exposed-modules: DataFrame.Fusion.FFI
4666
DataFrame.Fusion.Plan
4767
DataFrame.Fusion.Typed
@@ -68,6 +88,8 @@ test-suite tests
6888
import: warnings
6989
type: exitcode-stdio-1.0
7090
main-is: Main.hs
91+
if flag(no-csv) || flag(no-parquet)
92+
buildable: False
7193
build-depends: base >= 4 && < 5,
7294
dataframe >= 1 && < 3,
7395
dataframe-core ^>= 1.0,

dataframe.cabal

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: dataframe
3-
version: 2.0.0.0
3+
version: 2.1.0.0
44

55
synopsis: A fast, safe, and intuitive DataFrame library.
66

@@ -74,6 +74,49 @@ library
7474
ghc-options: -Werror=unused-packages
7575
exposed-modules: DataFrame,
7676
DataFrame.Typed
77+
reexported-modules: DataFrame.Functions,
78+
DataFrame.Synthesis,
79+
DataFrame.Display.Web.Plot,
80+
DataFrame.Internal.Types,
81+
DataFrame.Internal.Expression,
82+
DataFrame.Internal.Grouping,
83+
DataFrame.Internal.Interpreter,
84+
DataFrame.Internal.Nullable,
85+
DataFrame.Internal.Parsing,
86+
DataFrame.Internal.Column,
87+
DataFrame.Internal.Binary,
88+
DataFrame.Internal.Statistics,
89+
DataFrame.Display.Terminal.PrettyPrint,
90+
DataFrame.Display.Terminal.Colours,
91+
DataFrame.Internal.DataFrame,
92+
DataFrame.Internal.Row,
93+
DataFrame.Internal.Schema,
94+
DataFrame.Errors,
95+
DataFrame.Operations.Core,
96+
DataFrame.Operations.Join,
97+
DataFrame.Operations.Merge,
98+
DataFrame.Operators,
99+
DataFrame.Operations.Permutation,
100+
DataFrame.Operations.Subset,
101+
DataFrame.Operations.Statistics,
102+
DataFrame.Operations.Transformations,
103+
DataFrame.Operations.Typing,
104+
DataFrame.Operations.Aggregation,
105+
DataFrame.Display,
106+
DataFrame.Display.Terminal.Plot,
107+
DataFrame.Monad,
108+
DataFrame.DecisionTree,
109+
DataFrame.IO.JSON,
110+
DataFrame.Typed.Types,
111+
DataFrame.Typed.Schema,
112+
DataFrame.Typed.Freeze,
113+
DataFrame.Typed.Access,
114+
DataFrame.Typed.Operations,
115+
DataFrame.Typed.Join,
116+
DataFrame.Typed.Aggregate,
117+
DataFrame.Typed.Expr,
118+
DataFrame.Typed.Record,
119+
DataFrame.Typed.Generic
77120
build-depends: base >= 4 && <5,
78121
dataframe-core ^>= 1.0,
79122
dataframe-json ^>= 1.0,
@@ -83,16 +126,39 @@ library
83126
dataframe-learn ^>= 1.0
84127

85128
if !flag(no-csv)
129+
reexported-modules: DataFrame.IO.CSV
86130
build-depends: dataframe-csv ^>= 1.0
87131
cpp-options: -DWITH_CSV
88132

89133
if !flag(no-parquet)
134+
reexported-modules: DataFrame.IO.Parquet,
135+
DataFrame.IO.Parquet.Binary,
136+
DataFrame.IO.Parquet.Dictionary,
137+
DataFrame.IO.Parquet.Levels,
138+
DataFrame.IO.Parquet.Thrift,
139+
DataFrame.IO.Parquet.Decompress,
140+
DataFrame.IO.Parquet.Encoding,
141+
DataFrame.IO.Parquet.Page,
142+
DataFrame.IO.Parquet.Schema,
143+
DataFrame.IO.Parquet.Utils,
144+
DataFrame.IO.Parquet.Seeking,
145+
DataFrame.IO.Parquet.Time,
146+
DataFrame.IO.Utils.RandomAccess
90147
build-depends: dataframe-parquet ^>= 1.0
91148
cpp-options: -DWITH_PARQUET
92149

93150
-- The lazy executor calls both CSV and Parquet readers directly, so
94151
-- it can only be pulled in when both backends are present.
95152
if !flag(no-csv) && !flag(no-parquet)
153+
reexported-modules: DataFrame.Lazy,
154+
DataFrame.Lazy.IO.Binary,
155+
DataFrame.Lazy.IO.CSV,
156+
DataFrame.Lazy.Internal.DataFrame,
157+
DataFrame.Lazy.Internal.LogicalPlan,
158+
DataFrame.Lazy.Internal.PhysicalPlan,
159+
DataFrame.Lazy.Internal.Optimizer,
160+
DataFrame.Lazy.Internal.Executor,
161+
DataFrame.Typed.Lazy
96162
build-depends: dataframe-lazy ^>= 1.0
97163
cpp-options: -DWITH_LAZY
98164

@@ -196,7 +262,6 @@ executable lazy-bench
196262
dataframe >= 1 && < 3,
197263
dataframe-core ^>= 1.0,
198264
dataframe-lazy ^>= 1.0,
199-
dataframe-operations ^>= 1.0,
200265
dataframe-parsing ^>= 1.0,
201266
directory >= 1.3.0.0 && < 2,
202267
random >= 1 && < 2,

scripts/repl.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ chcp 65001
33
[Console]::InputEncoding = [System.Text.UTF8Encoding]::new($false)
44
$env:GHC_CHARENC = "UTF-8"
55

6-
cabal repl dataframe --repl-options=-fobject-code -O2
6+
cabal repl dataframe --repl-options=-fobject-code -O2 --build-depends=text --build-depends=vector --build-depends=bytestring --build-depends=time

scripts/repl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
cabal repl dataframe --repl-options=-fobject-code -O2
3+
cabal repl dataframe --repl-options=-fobject-code -O2 --build-depends=text --build-depends=vector --build-depends=bytestring --build-depends=time

0 commit comments

Comments
 (0)