git.iko.soy/typeable/cassava-streams
on trunk help sign in
Update dependencies, prepare for next release
commitb635f38a193f9ca619304f93c402ea75dbd35f29 authorPeter Jones <pjones@devalot.com> dateThu 29 Oct 2020, 10:09 (6 years ago) parentfa7592a
11 files changed+169−97
.envrc+4−11 .github/workflows/analysis.yml+22 .github/workflows/tests.yml+63 .gitignore+1 CHANGES.md+9−23 LICENSE+1−1 cassava-streams.cabal+50−46 default.nix+5−2 nix/sources.json+12−12 src/System/IO/Streams/Csv/Decode.hs+1−1 test/test.hs+1−1
.envrc+4−11
@@ -1,17 +1,10 @@
11# -*- sh -*-
22
3−# Use nixpkgs from nix/sources.json:
4−if has jq; then
5− nixpkgs=$(jq --raw-output .nixpkgs.url nix/sources.json)
6− export NIX_PATH=nixpkgs="$nixpkgs"
7−fi
3+# Don't let cabal leak state to other projects:
4+export CABAL_DIR=$(pwd)/.cabal
85
96# Load in the shell.nix file:
10−if has lorri; then
11− eval "$(lorri direnv)"
12−else
13− use nix
14−fi
7+use nix
158
169# Reload if these files change:
17−watch_file $(find . -name '*.cabal' -o -name '*.nix')
10+watch_file nix/sources.json
.github/workflows/analysis.ymlnew file+22
@@ -0,0 +1,22 @@
1+name: Analysis
2+on:
3+ pull_request:
4+jobs:
5+ check:
6+ name: pre-merge-checks
7+ runs-on: ubuntu-latest
8+ steps:
9+ - name: Clone Repository
10+ uses: actions/checkout@v2
11+
12+ - name: Setup Haskell
13+ id: setup-haskell-cabal
14+ uses: actions/setup-haskell@v1.1.3
15+ with:
16+ ghc-version: 8.8
17+
18+ - name: Cabal Check
19+ run: cabal check
20+
21+ - name: Lint
22+ run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s .
.github/workflows/tests.ymlnew file+63
@@ -0,0 +1,63 @@
1+name: CI
2+on:
3+ pull_request:
4+jobs:
5+ cabal:
6+ name: ${{ matrix.os }} / ghc-${{ matrix.ghc }}
7+ runs-on: ${{ matrix.os }}
8+ strategy:
9+ fail-fast: false
10+ matrix:
11+ os: [ubuntu-latest, macOS-latest, windows-latest]
12+ cabal: ["3.2"]
13+ ghc: ["8.6.5", "8.8.4", "8.10.2"]
14+ # Newer versions of GHC are broken on Windows:
15+ # https://gitlab.haskell.org/ghc/ghc/-/issues/17926
16+ exclude:
17+ - os: windows-latest
18+ ghc: "8.8.4"
19+ - os: windows-latest
20+ ghc: "8.10.2"
21+ steps:
22+ - name: Clone Repository
23+ uses: actions/checkout@v2
24+
25+ - name: Setup Haskell
26+ id: setup-haskell-cabal
27+ uses: actions/setup-haskell@v1.1.3
28+ with:
29+ ghc-version: ${{ matrix.ghc }}
30+ cabal-version: ${{ matrix.cabal }}
31+
32+ - name: Configure and Freeze for Cache
33+ run: |
34+ cabal configure --enable-tests --enable-benchmarks --test-show-details=direct -ftutorial
35+ cabal freeze
36+
37+ - name: Cache ~/.cabal/store
38+ uses: actions/cache@v1
39+ with:
40+ path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
41+ key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
42+
43+ - name: Build
44+ run: cabal build '--build-log=logs/$pkgid'
45+
46+ - name: Test
47+ run: cabal test
48+
49+ - name: Upload Build Logs on Failure
50+ uses: actions/upload-artifact@v2
51+ if: failure()
52+ with:
53+ name: logs-${{ matrix.os }}-ghc${{ matrix.ghc }}
54+ path: logs/
55+
56+ - name: Install
57+ run: cabal install --installdir=artifacts --install-method=copy
58+
59+ - name: Upload Artifacts
60+ uses: actions/upload-artifact@v2
61+ with:
62+ name: ${{ matrix.os }}-ghc${{ matrix.ghc }}
63+ path: artifacts/
.gitignore+1
@@ -3,3 +3,4 @@
33/build/.stack-work
44/dist
55/result
6+/.cabal/
CHANGES.md+9−23
@@ -1,28 +1,6 @@
11# Change Log / Release Notes
22
3−## 0.3.0.4 (April 15, 2019)
4−
5− * Bumped dependencies
6−
7− * Builds on NixOS 18.09, 19.03, and unstable
8−
9−## 0.3.0.3 (October 09, 2018)
10−
11− * Bumped dependencies
12−
13−## 0.3.0.2 (March 20, 2018)
14−
15− * Updated to LTS Haskell 11.1
16−
17− * Bumped dependencies
18−
19−## 0.3.0.1 (April 14, 2017)
20−
21− * Updated to LTS Haskell 8.9
22−
23− * Bumped dependencies
24−
25−## 0.3.0.0 (August 11, 2016)
3+## 0.3 (August 11, 2016)
264
275 * Add some additional (convenience) exports from `Data.Csv`. (Thanks
286 goes to Florian Hofmann.)
@@ -31,6 +9,14 @@
319
3210 * Updated to LTS Haskell 6.7
3311
12+ * Minor updates:
13+
14+ - 0.3.0.1 (April 14, 2017): Updated dependencies
15+ - 0.3.0.2 (March 20, 2018): Updated dependencies
16+ - 0.3.0.3 (October 09, 2018): Updated dependencies
17+ - 0.3.0.4 (April 15, 2019): Updated dependencies
18+ - 0.3.0.5 (October 29, 2020): Update dependencies
19+
3420## 0.2.0.0 (February 8, 2016)
3521
3622 * Compile with GHC 7.10.3
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2014-2019 Peter Jones <pjones@devalot.com>
1+Copyright (c) 2014-2020 Peter Jones <pjones@devalot.com>
22
33All rights reserved.
44
cassava-streams.cabal+50−46
@@ -1,17 +1,17 @@
1−--------------------------------------------------------------------------------
2−name: cassava-streams
3−version: 0.3.0.4
4−synopsis: io-streams interface for the cassava CSV library.
5−license: BSD3
6−license-file: LICENSE
7−author: Peter Jones <pjones@devalot.com>
8−maintainer: Peter Jones <pjones@devalot.com>
9−copyright: Copyright (c) 2014-2019 Peter Jones
10−category: Data, Text, CSV, IO-Streams
11−build-type: Simple
12−cabal-version: 1.18
13−homepage: https://code.devalot.com/open/cassava-streams
14−bug-reports: https://code.devalot.com/open/cassava-streams/issues
1+cabal-version: 2.2
2+name: cassava-streams
3+version: 0.3.0.5
4+synopsis: io-streams interface for the cassava CSV library.
5+license: BSD-3-Clause
6+license-file: LICENSE
7+author: Peter Jones <pjones@devalot.com>
8+maintainer: Peter Jones <pjones@devalot.com>
9+copyright: Copyright (c) 2014-2020 Peter Jones
10+category: Data, Text, CSV, IO-Streams
11+build-type: Simple
12+homepage: https://github.com/pjones/cassava-streams
13+bug-reports: https://github.com/pjones/cassava-streams/issues
14+tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.2
1515description:
1616 The cassava-streams library glues togeter the cassava CSV library
1717 and the io-streams streaming library.
@@ -27,61 +27,65 @@ extra-source-files:
2727--------------------------------------------------------------------------------
2828source-repository head
2929 type: git
30− location: https://code.devalot.com/open/cassava-streams.git
30+ location: https://github.com/pjones/cassava-streams.git
3131
3232--------------------------------------------------------------------------------
3333flag tutorial
3434 description: Build the tutorial binary (useful for profiling).
35− manual: True
36− default: False
35+ manual: True
36+ default: False
37+
38+--------------------------------------------------------------------------------
39+common dependencies
40+ build-depends:
41+ , base >=4.8 && <5.0
42+ , bytestring >=0.10 && <0.12
43+ , cassava >=0.4 && <0.6
44+ , io-streams >=1.1 && <1.6
45+ , vector >=0.10 && <0.13
3746
3847--------------------------------------------------------------------------------
3948library
49+ import: dependencies
4050 exposed-modules:
4151 System.IO.Streams.Csv
4252 System.IO.Streams.Csv.Tutorial
53+
4354 other-modules:
44− System.IO.Streams.Csv.Encode
4555 System.IO.Streams.Csv.Decode
56+ System.IO.Streams.Csv.Encode
4657
47− hs-source-dirs: src
58+ hs-source-dirs: src
4859 default-language: Haskell2010
49− ghc-options: -Wall -fwarn-incomplete-uni-patterns
50−
51− build-depends: base >= 4.8 && < 5.0
52− , bytestring >= 0.10 && < 0.11
53− , cassava >= 0.4 && < 0.6
54− , io-streams >= 1.1 && < 1.6
55− , vector >= 0.10 && < 0.13
60+ ghc-options: -Wall -fwarn-incomplete-uni-patterns
61+ build-depends:
5662
5763--------------------------------------------------------------------------------
5864executable tutorial
5965 default-language: Haskell2010
60− hs-source-dirs: bin
61− main-is: tutorial.hs
62− ghc-options: -Wall -fwarn-incomplete-uni-patterns -rtsopts
66+ hs-source-dirs: bin
67+ main-is: tutorial.hs
68+ ghc-options: -Wall -fwarn-incomplete-uni-patterns -rtsopts
6369
6470 if !flag(tutorial)
6571 buildable: False
72+
6673 else
67− build-depends: base
68− , cassava-streams
69− , io-streams
74+ build-depends:
75+ , base
76+ , cassava-streams
77+ , io-streams
7078
7179--------------------------------------------------------------------------------
7280test-suite test
73− type: exitcode-stdio-1.0
81+ import: dependencies
82+ type: exitcode-stdio-1.0
7483 default-language: Haskell2010
75− hs-source-dirs: test
76− main-is: test.hs
77− ghc-options: -Wall -fwarn-incomplete-uni-patterns
78−
79− build-depends: base
80− , QuickCheck >= 2.7 && < 3.0
81− , bytestring
82− , cassava
83− , cassava-streams
84− , io-streams
85− , tasty >= 0.8 && < 1.3
86− , tasty-quickcheck >= 0.8 && < 1.3
87− , vector
84+ hs-source-dirs: test
85+ main-is: test.hs
86+ ghc-options: -Wall -fwarn-incomplete-uni-patterns
87+ build-depends:
88+ , cassava-streams
89+ , QuickCheck >=2.7 && <3.0
90+ , tasty >=0.8 && <1.5
91+ , tasty-quickcheck >=0.8 && <1.3
default.nix+5−2
@@ -1,5 +1,8 @@
1−{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { }
2−, nix-hs ? import sources.nix-hs { inherit pkgs; }, ghc ? "default" }:
1+{ sources ? import ./nix/sources.nix
2+, pkgs ? import sources.nixpkgs { }
3+, nix-hs ? import sources.nix-hs { inherit pkgs; }
4+, ghc ? "default"
5+}:
36
47nix-hs {
58 cabal = ./cassava-streams.cabal;
nix/sources.json+12−12
@@ -12,27 +12,27 @@
1212 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313 },
1414 "nix-hs": {
15− "branch": "master",
15+ "branch": "release-20.09",
1616 "description": "Haskell + nixpkgs = nix-hs",
17− "homepage": null,
17+ "homepage": "",
1818 "owner": "pjones",
1919 "repo": "nix-hs",
20− "rev": "26fcc02fff3aafb73de29165ecf82abd3b088e98",
21− "sha256": "021rzc1g1a80rh96whpf5vr9h2angy1janv71n0clbv01lizn9ar",
20+ "rev": "67163bb02a8791d79136ba6914b6d6dad594533b",
21+ "sha256": "0f7sjh45wxbf2m76l37f4l4v4dkq32dm599p85acx53324nr9y8z",
2222 "type": "tarball",
23− "url": "https://github.com/pjones/nix-hs/archive/26fcc02fff3aafb73de29165ecf82abd3b088e98.tar.gz",
23+ "url": "https://github.com/pjones/nix-hs/archive/67163bb02a8791d79136ba6914b6d6dad594533b.tar.gz",
2424 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525 },
2626 "nixpkgs": {
27− "branch": "nixpkgs-unstable",
28− "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
29− "homepage": "https://github.com/NixOS/nixpkgs",
27+ "branch": "nixos-20.09",
28+ "description": "Nix Packages collection",
29+ "homepage": "",
3030 "owner": "NixOS",
31− "repo": "nixpkgs-channels",
32− "rev": "1ae28ebfdb7e7d48f003881967db67c156724912",
33− "sha256": "1qqzxaf0nfsg8zdgr5kghih4pr46q5acbnpzihnsdiiykz4xvs3f",
31+ "repo": "nixpkgs",
32+ "rev": "edb26126d98bc696f4f3e206583faa65d3d6e818",
33+ "sha256": "1cl4ka4kk7kh3bl78g06dhiidazf65q8miyzaxi9930d6gwyzkci",
3434 "type": "tarball",
35− "url": "https://github.com/NixOS/nixpkgs-channels/archive/1ae28ebfdb7e7d48f003881967db67c156724912.tar.gz",
35+ "url": "https://github.com/NixOS/nixpkgs/archive/edb26126d98bc696f4f3e206583faa65d3d6e818.tar.gz",
3636 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737 }
3838}
src/System/IO/Streams/Csv/Decode.hs+1−1
@@ -37,7 +37,7 @@ import qualified System.IO.Streams as Streams
3737--------------------------------------------------------------------------------
3838-- | Exception thrown when stream decoding cannot continue due to an
3939-- error.
40−data StreamDecodingError = StreamDecodingError String
40+newtype StreamDecodingError = StreamDecodingError String
4141 deriving (Typeable, Show)
4242
4343instance Exception StreamDecodingError
test/test.hs+1−1
@@ -70,7 +70,7 @@ roundTrip is os recs = do
7070 Streams.connect sourceList encoder
7171
7272 -- Decode from ByteString.
73− decoder <- fmap BS.concat encoded >>= Streams.fromByteString >>= is
73+ decoder <- (encoded >>= Streams.fromByteString . BS.concat) >>= is
7474 (decodeStream, decoded) <- Streams.listOutputStream
7575 Streams.connect decoder decodeStream
7676 decoded