commit ghc-cassava for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-cassava for openSUSE:Factory checked in at 2022-08-01 21:31:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-cassava (Old) and /work/SRC/openSUSE:Factory/.ghc-cassava.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-cassava" Mon Aug 1 21:31:31 2022 rev:10 rq:990788 version:0.5.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-cassava/ghc-cassava.changes 2022-02-11 23:10:35.607151428 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-cassava.new.1533/ghc-cassava.changes 2022-08-01 21:32:17.401981988 +0200 @@ -1,0 +2,19 @@ +Sun Jul 10 17:49:48 UTC 2022 - Peter Simons <psimons@suse.com> + +- Update cassava to version 0.5.3.0. + ## Version 0.5.3.0 + + * Improve error messages for `lookup` and NamedRecord parsers (#197) + * Fix bug (infinite loop) in `FromField Const` instance (#185) + * Turn flag `bytestring--LT-0_10_4` off by default (#183) + * Doc: Add cassava usage example of reading/writing to file (#97) + * Update to latest version of dependencies (#190, #193, #199) + * Tested with GHC 7.4 - 9.4 (#184, #204) + +------------------------------------------------------------------- +Wed Jun 22 06:15:02 UTC 2022 - Peter Simons <psimons@suse.com> + +- Update cassava to version 0.5.2.0 revision 8. + Upstream has revised the Cabal build instructions on Hackage. + +------------------------------------------------------------------- Old: ---- cassava-0.5.2.0.tar.gz cassava.cabal New: ---- cassava-0.5.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-cassava.spec ++++++ --- /var/tmp/diff_new_pack.DpnO7O/_old 2022-08-01 21:32:17.869983331 +0200 +++ /var/tmp/diff_new_pack.DpnO7O/_new 2022-08-01 21:32:17.877983354 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-cassava # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,12 @@ %global pkg_name cassava %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.5.2.0 +Version: 0.5.3.0 Release: 0 Summary: A CSV parsing and encoding library License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/7.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-Only-devel BuildRequires: ghc-array-devel @@ -88,7 +87,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %define cabal_configure_options -f-bytestring--lt-0_10_4 ++++++ cassava-0.5.2.0.tar.gz -> cassava-0.5.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/CHANGES.md new/cassava-0.5.3.0/CHANGES.md --- old/cassava-0.5.2.0/CHANGES.md 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/CHANGES.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,12 @@ +## Version 0.5.3.0 + + * Improve error messages for `lookup` and NamedRecord parsers (#197) + * Fix bug (infinite loop) in `FromField Const` instance (#185) + * Turn flag `bytestring--LT-0_10_4` off by default (#183) + * Doc: Add cassava usage example of reading/writing to file (#97) + * Update to latest version of dependencies (#190, #193, #199) + * Tested with GHC 7.4 - 9.4 (#184, #204) + ## Version 0.5.2.0 * Add `FromField`/`ToField` instances for `Identity` and `Const` (#158) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/README.md new/cassava-0.5.3.0/README.md --- old/cassava-0.5.2.0/README.md 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/README.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,7 @@ -# `cassava`: A CSV parsing and encoding library [![Hackage](https://img.shields.io/hackage/v/cassava.svg)](https://hackage.haskell.org/package/cassava) [![Build Status](https://travis-ci.org/hvr/cassava.svg)](https://travis-ci.org/hvr/cassava) +[![Hackage](https://img.shields.io/hackage/v/cassava.svg?label=Hackage&color=informational)](https://hackage.haskell.org/package/cassava) +[![Cabal build](https://github.com/haskell-hvr/cassava/workflows/Haskell-CI/badge.svg)](https://github.com/haskell-hvr/cassava/actions) + +# `cassava`: A CSV parsing and encoding library **Please refer to the [package description](https://hackage.haskell.org/package/cassava#description) for an overview of `cassava`.** @@ -91,7 +94,7 @@ ## Further reading -The primary API documentation for `cassava` is its Haddock documentation which can be found at http://hackage.haskell.org/package/cassava/docs/Data-Csv.html +The primary API documentation for `cassava` is its Haddock documentation which can be found at http://hackage.haskell.org/package/cassava/docs/Data-Csv.html Below are listed additional recommended third-party blogposts and tutorials diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/Setup.hs new/cassava-0.5.3.0/Setup.hs --- old/cassava-0.5.2.0/Setup.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/Setup.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,8 +1,3 @@ import Distribution.Simple main = defaultMain - - - - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/cassava.cabal new/cassava-0.5.3.0/cassava.cabal --- old/cassava-0.5.2.0/cassava.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/cassava.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 1.12 Name: cassava -Version: 0.5.2.0 +Version: 0.5.3.0 Synopsis: A CSV parsing and encoding library Description: { @@ -28,30 +28,45 @@ Please refer to the documentation in "Data.Csv" and the included [README](#readme) for more usage examples. } -Homepage: https://github.com/hvr/cassava +Homepage: https://github.com/haskell-hvr/cassava License: BSD3 License-file: LICENSE -Bug-reports: https://github.com/hvr/cassava/issues +Bug-reports: https://github.com/haskell-hvr/cassava/issues Copyright: (c) 2012 Johan Tibell (c) 2012 Bryan O'Sullivan (c) 2011 MailRank, Inc. Author: Johan Tibell -Maintainer: hvr@gnu.org +Maintainer: https://github.com/haskell-hvr/cassava Category: Text, Web, CSV Build-type: Simple Extra-source-files: examples/*.hs, CHANGES.md, README.md -Tested-with: GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC ==8.2.2, GHC ==8.0.2, GHC ==7.10.3, GHC ==7.8.4, GHC ==7.6.3, GHC ==7.4.2 +Tested-with: + GHC == 9.4.1 + GHC == 9.2.3 + GHC == 9.0.2 + GHC == 8.10.7 + GHC == 8.8.4 + GHC == 8.6.5 + GHC == 8.4.4 + GHC == 8.2.2 + GHC == 8.0.2 + GHC == 7.10.3 + GHC == 7.8.4 + GHC == 7.6.3 + GHC == 7.4.2 ---------------------------------------------------------------------------- source-repository head type: git - location: https://github.com/hvr/cassava.git + location: https://github.com/haskell-hvr/cassava.git flag bytestring--LT-0_10_4 description: [bytestring](https://hackage.haskell.org/haskell/package/bytestring) < 0.10.4 + default: False + manual: False Library default-language: Haskell2010 @@ -94,19 +109,19 @@ Data.Csv.Util Build-depends: - array >= 0.4 && < 0.6, - attoparsec >= 0.11.3.0 && < 0.14, - base >= 4.5 && < 4.14, - bytestring >= 0.9.2 && < 0.11, - containers >= 0.4.2 && < 0.7, - deepseq >= 1.1 && < 1.5, - hashable < 1.4, - scientific >= 0.3.4.7 && < 0.4, - text < 1.3, - transformers >= 0.2 && < 0.6, - unordered-containers < 0.3, - vector >= 0.8 && < 0.13, - Only >= 0.1 && < 0.1.1 + base >= 4.5 && < 4.18 + , array >= 0.4 && < 0.6 + , attoparsec >= 0.11.3.0 && < 0.15 + , bytestring >= 0.9.2 && < 0.12 + , containers >= 0.4.2 && < 0.7 + , deepseq >= 1.1 && < 1.5 + , hashable < 1.5 + , scientific >= 0.3.4.7 && < 0.4 + , text < 2.1 + , transformers >= 0.2 && < 0.7 + , unordered-containers < 0.3 + , vector >= 0.8 && < 0.14 + , Only >= 0.1 && < 0.1.1 if flag(bytestring--LT-0_10_4) build-depends: bytestring < 0.10.4 @@ -137,7 +152,7 @@ if impl(ghc >= 8.2) ghc-options: -Wcpp-undef - ghc-options: -Wall -O2 + ghc-options: -Wall ---------------------------------------------------------------------------- @@ -158,7 +173,7 @@ , vector -- extra dependencies not already used by lib:cassava build-depends: HUnit < 1.7 - , QuickCheck == 2.13.* + , QuickCheck == 2.14.* , quickcheck-instances >= 0.3.12 && < 0.4 , test-framework == 0.8.* , test-framework-hunit == 0.3.* @@ -176,7 +191,9 @@ -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#Recommendationsforforwar... if impl(ghc >= 8.0) - ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances + ghc-options: -Wcompat -Wnoncanonical-monad-instances + if impl(ghc < 8.8) + ghc-options: -Wnoncanonical-monadfail-instances else -- provide/emulate `Control.Monad.Fail` and `Data.Semigroups` API for pre-GHC8 build-depends: fail, semigroups diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/examples/NamedBasedExplicitDecode.hs new/cassava-0.5.3.0/examples/NamedBasedExplicitDecode.hs --- old/cassava-0.5.2.0/examples/NamedBasedExplicitDecode.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/examples/NamedBasedExplicitDecode.hs 2001-09-09 03:46:40.000000000 +0200 @@ -18,4 +18,4 @@ case decodeByNameWithP valueParse defaultDecodeOptions csvData of Left err -> putStrLn err Right (_, v) -> V.forM_ v $ \ p -> - putStrLn $ name p ++ " earns " ++ show (salary p) ++ " dollars" \ No newline at end of file + putStrLn $ name p ++ " earns " ++ show (salary p) ++ " dollars" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/src/Data/Csv/Conversion.hs new/cassava-0.5.3.0/src/Data/Csv/Conversion.hs --- old/cassava-0.5.2.0/src/Data/Csv/Conversion.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/src/Data/Csv/Conversion.hs 2001-09-09 03:46:40.000000000 +0200 @@ -811,7 +811,7 @@ -- | @since 0.5.2.0 instance FromField a => FromField (Const a b) where - parseField = fmap getConst . parseField + parseField = fmap Const . parseField {-# INLINE parseField #-} -- | @since 0.5.2.0 @@ -1148,8 +1148,11 @@ -- 'empty' if the field is missing or if the value cannot be converted -- to the desired type. lookup :: FromField a => NamedRecord -> B.ByteString -> Parser a -lookup m name = maybe (fail err) parseField $ HM.lookup name m +lookup m name = maybe (fail err) parseField' $ HM.lookup name m where err = "no field named " ++ show (B8.unpack name) + parseField' fld = case runParser (parseField fld) of + Left e -> fail $ "in named field " ++ show (B8.unpack name) ++ ": " ++ e + Right res -> pure res {-# INLINE lookup #-} -- | Alias for 'lookup'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/src/Data/Csv.hs new/cassava-0.5.3.0/src/Data/Csv.hs --- old/cassava-0.5.2.0/src/Data/Csv.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/src/Data/Csv.hs 2001-09-09 03:46:40.000000000 +0200 @@ -24,6 +24,9 @@ -- *** Name-based record conversion -- $example-named-instance + -- ** Reading/writing CSV files + -- $example-file + -- * Treating CSV data as opaque byte strings -- $generic-processing @@ -152,6 +155,63 @@ -- In practice, the return type of 'decode' rarely needs to be given, -- as it can often be inferred from the context. +-- $example-file +-- +-- Demonstration of reading from a CSV file/ writing to a CSV file +-- using the incremental API: +-- +-- > {-# LANGUAGE BangPatterns #-} +-- > {-# LANGUAGE DeriveGeneric #-} +-- > {-# LANGUAGE LambdaCase #-} +-- > {-# LANGUAGE OverloadedStrings #-} +-- > +-- > -- from base +-- > import GHC.Generics +-- > import System.IO +-- > import System.Exit (exitFailure) +-- > -- from bytestring +-- > import Data.ByteString (ByteString, hGetSome, empty) +-- > import qualified Data.ByteString.Lazy as BL +-- > -- from cassava +-- > import Data.Csv.Incremental +-- > import Data.Csv (FromRecord, ToRecord) +-- > +-- > data Person = Person +-- > { name :: !ByteString +-- > , age :: !Int +-- > } deriving (Show, Eq, Generic) +-- > +-- > instance FromRecord Person +-- > instance ToRecord Person +-- > +-- > persons :: [Person] +-- > persons = [Person "John Doe" 19, Person "Smith" 20] +-- > +-- > writeToFile :: IO () +-- > writeToFile = do +-- > BL.writeFile "persons.csv" $ encode $ +-- > foldMap encodeRecord persons +-- > +-- > feed :: (ByteString -> Parser Person) -> Handle -> IO (Parser Person) +-- > feed k csvFile = do +-- > hIsEOF csvFile >>= \case +-- > True -> return $ k empty +-- > False -> k <$> hGetSome csvFile 4096 +-- > +-- > readFromFile :: IO () +-- > readFromFile = do +-- > withFile "persons.csv" ReadMode $ \ csvFile -> do +-- > let loop !_ (Fail _ errMsg) = do putStrLn errMsg; exitFailure +-- > loop acc (Many rs k) = loop (acc <> rs) =<< feed k csvFile +-- > loop acc (Done rs) = print (acc <> rs) +-- > loop [] (decode NoHeader) +-- > +-- > main :: IO () +-- > main = do +-- > writeToFile +-- > readFromFile +-- > + -- $example-instance -- -- To encode and decode your own data types you need to defined diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cassava-0.5.2.0/tests/UnitTests.hs new/cassava-0.5.3.0/tests/UnitTests.hs --- old/cassava-0.5.2.0/tests/UnitTests.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cassava-0.5.3.0/tests/UnitTests.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP, DeriveGeneric, OverloadedStrings, ScopedTypeVariables #-} +{-# LANGUAGE CPP, DataKinds, DeriveGeneric, OverloadedStrings, ScopedTypeVariables #-} #if __GLASGOW_HASKELL__ >= 801 {-# OPTIONS_GHC -Wno-orphans -Wno-unused-top-binds #-} @@ -10,6 +10,7 @@ ( main ) where +import Control.Applicative (Const) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BL8 @@ -303,6 +304,15 @@ (roundTrip :: BL.ByteString -> Bool) , testProperty "Text" (roundTrip :: T.Text -> Bool) , testProperty "lazy Text" (roundTrip :: LT.Text -> Bool) + +#if __GLASGOW_HASKELL__ >= 800 + -- Using DataKinds here to prove that our Const instance is polykinded. + , testProperty "Const Char" (roundTrip :: Const Char "" -> Bool) +#else + -- For lower GHC versions, Const does not support PolyKinds. + , testProperty "Const Char" (roundTrip :: Const Char () -> Bool) +#endif + ] , testGroup "boundary" [ testProperty "Int" (boundary (undefined :: Int))
participants (1)
-
Source-Sync