Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-servant for openSUSE:Factory checked in at 2021-07-05 22:22:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-servant (Old) and /work/SRC/openSUSE:Factory/.ghc-servant.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-servant" Mon Jul 5 22:22:41 2021 rev:6 rq:903728 version:0.18.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-servant/ghc-servant.changes 2021-06-01 10:40:33.413129218 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-servant.new.2625/ghc-servant.changes 2021-07-05 22:22:57.061735389 +0200 @@ -1,0 +2,17 @@ +Thu Jun 24 12:02:53 UTC 2021 - [email protected] + +- Update servant to version 0.18.3. + 0.18.3 + ------ + + ### Significant changes + + - Add response header support to UVerb (#1420). + - Use Capture Description if available (#1423). + + ### Other changes + + - Support GHC-9.0.1. + - Bump `bytestring`, `attoparsec`, `hspec` and `singleton-bool` dependencies. + +------------------------------------------------------------------- Old: ---- servant-0.18.2.tar.gz servant.cabal New: ---- servant-0.18.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-servant.spec ++++++ --- /var/tmp/diff_new_pack.2rQ8Ts/_old 2021-07-05 22:22:57.625731024 +0200 +++ /var/tmp/diff_new_pack.2rQ8Ts/_new 2021-07-05 22:22:57.629730993 +0200 @@ -19,13 +19,12 @@ %global pkg_name servant %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.18.2 +Version: 0.18.3 Release: 0 Summary: A family of combinators for defining webservices APIs 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/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-QuickCheck-devel BuildRequires: ghc-aeson-devel @@ -76,11 +75,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal -cabal-tweak-dep-ver 'base' '< 4.15' '< 5' -cabal-tweak-dep-ver 'attoparsec' '< 0.14' '< 0.15' -cabal-tweak-dep-ver 'http-api-data' '< 0.4.3' '< 0.5' -cabal-tweak-dep-ver 'singleton-bool' '< 0.1.6' '< 0.2' %build %ghc_lib_build ++++++ servant-0.18.2.tar.gz -> servant-0.18.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/CHANGELOG.md new/servant-0.18.3/CHANGELOG.md --- old/servant-0.18.2/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,18 @@ [The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md) +0.18.3 +------ + +### Significant changes + +- Add response header support to UVerb (#1420). +- Use Capture Description if available (#1423). + +### Other changes + +- Support GHC-9.0.1. +- Bump `bytestring`, `attoparsec`, `hspec` and `singleton-bool` dependencies. + 0.18.2 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/servant.cabal new/servant-0.18.3/servant.cabal --- old/servant-0.18.2/servant.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/servant.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: >=1.10 name: servant -version: 0.18.2 +version: 0.18.3 synopsis: A family of combinators for defining webservices APIs category: Servant, Web @@ -20,7 +20,7 @@ copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1 , GHCJS == 8.4 extra-source-files: @@ -78,8 +78,8 @@ -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.15 - , bytestring >= 0.10.8.1 && < 0.11 + base >= 4.9 && < 4.16 + , bytestring >= 0.10.8.1 && < 0.12 , mtl >= 2.2.2 && < 2.3 , sop-core >= 0.4.0.0 && < 0.6 , transformers >= 0.5.2.0 && < 0.6 @@ -89,15 +89,15 @@ -- We depend (heavily) on the API of these packages: -- i.e. re-export, or allow using without direct dependency build-depends: - http-api-data >= 0.4.1 && < 0.4.3 - , singleton-bool >= 0.1.4 && < 0.1.6 + http-api-data >= 0.4.1 && < 0.4.4 + , singleton-bool >= 0.1.4 && < 0.1.7 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. build-depends: base-compat >= 0.10.5 && < 0.12 , aeson >= 1.4.1.0 && < 1.6 - , attoparsec >= 0.13.2.2 && < 0.14 + , attoparsec >= 0.13.2.2 && < 0.15 , bifunctors >= 5.5.3 && < 5.6 , case-insensitive >= 1.2.0.11 && < 1.3 , deepseq >= 1.4.2.0 && < 1.5 @@ -163,9 +163,9 @@ -- Additional dependencies build-depends: - hspec >= 2.6.0 && < 2.8 + hspec >= 2.6.0 && < 2.9 , QuickCheck >= 2.12.6.1 && < 2.15 , quickcheck-instances >= 0.3.19 && < 0.4 build-tool-depends: - hspec-discover:hspec-discover >= 2.6.0 && < 2.8 + hspec-discover:hspec-discover >= 2.6.0 && < 2.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/API/ContentTypes.hs new/servant-0.18.3/src/Servant/API/ContentTypes.hs --- old/servant-0.18.2/src/Servant/API/ContentTypes.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/API/ContentTypes.hs 2001-09-09 03:46:40.000000000 +0200 @@ -20,7 +20,7 @@ -- -- Content-Types are used in `ReqBody` and the method combinators: -- --- >>> type MyEndpoint = ReqBody '[JSON, PlainText] Book :> Get '[JSON, PlainText] Book +-- >>> type MyEndpoint = ReqBody '[JSON, PlainText] Book :> Put '[JSON, PlainText] Book -- -- Meaning the endpoint accepts requests of Content-Type @application/json@ -- or @text/plain;charset-utf8@, and returns data in either one of those diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/API/ResponseHeaders.hs new/servant-0.18.3/src/Servant/API/ResponseHeaders.hs --- old/servant-0.18.2/src/Servant/API/ResponseHeaders.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/API/ResponseHeaders.hs 2001-09-09 03:46:40.000000000 +0200 @@ -51,6 +51,9 @@ import Prelude () import Prelude.Compat +import Servant.API.ContentTypes + (JSON, PlainText, FormUrlEncoded, OctetStream, + MimeRender(..)) import Servant.API.Header (Header) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/API/UVerb/Union.hs new/servant-0.18.3/src/Servant/API/UVerb/Union.hs --- old/servant-0.18.2/src/Servant/API/UVerb/Union.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/API/UVerb/Union.hs 2001-09-09 03:46:40.000000000 +0200 @@ -47,7 +47,7 @@ -} -- | Type-level code for implementing and using 'UVerb'. Heavily inspired by --- [world-piece](https://github.com/cdepillabout/world-peace). +-- [world-peace](https://github.com/cdepillabout/world-peace). module Servant.API.UVerb.Union ( IsMember , Unique @@ -144,4 +144,4 @@ , Nubbed '[Int, Bool] ~ 'True ) => a) -> a -_testNubbed = id +_testNubbed a = a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/API/UVerb.hs new/servant-0.18.3/src/Servant/API/UVerb.hs --- old/servant-0.18.2/src/Servant/API/UVerb.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/API/UVerb.hs 2001-09-09 03:46:40.000000000 +0200 @@ -36,7 +36,7 @@ import Data.Proxy (Proxy (Proxy)) import GHC.TypeLits (Nat) import Network.HTTP.Types (Status, StdMethod) -import Servant.API.ContentTypes (NoContent, MimeRender(mimeRender), MimeUnrender(mimeUnrender)) +import Servant.API.ContentTypes (JSON, PlainText, FormUrlEncoded, OctetStream, NoContent, MimeRender(mimeRender), MimeUnrender(mimeUnrender)) import Servant.API.Status (KnownStatus, statusVal) import Servant.API.UVerb.Union @@ -69,13 +69,6 @@ newtype WithStatus (k :: Nat) a = WithStatus a deriving (Eq, Show) -instance MimeRender ctype a => MimeRender ctype (WithStatus _status a) where - mimeRender contentTypeProxy (WithStatus a) = mimeRender contentTypeProxy a - -instance MimeUnrender ctype a => MimeUnrender ctype (WithStatus _status a) where - mimeUnrender contentTypeProxy input = - WithStatus <$> mimeUnrender contentTypeProxy input - -- | an instance of this typeclass assigns a HTTP status code to a return type -- -- Example: @@ -105,3 +98,27 @@ -- Backwards compatibility is tricky, though: this type alias would mean people would have to -- use 'respond' instead of 'pure' or 'return', so all old handlers would have to be rewritten. data UVerb (method :: StdMethod) (contentTypes :: [*]) (as :: [*]) + +instance {-# OVERLAPPING #-} MimeRender JSON a => MimeRender JSON (WithStatus _status a) where + mimeRender contentTypeProxy (WithStatus a) = mimeRender contentTypeProxy a + +instance {-# OVERLAPPING #-} MimeRender PlainText a => MimeRender PlainText (WithStatus _status a) where + mimeRender contentTypeProxy (WithStatus a) = mimeRender contentTypeProxy a + +instance {-# OVERLAPPING #-} MimeRender FormUrlEncoded a => MimeRender FormUrlEncoded (WithStatus _status a) where + mimeRender contentTypeProxy (WithStatus a) = mimeRender contentTypeProxy a + +instance {-# OVERLAPPING #-} MimeRender OctetStream a => MimeRender OctetStream (WithStatus _status a) where + mimeRender contentTypeProxy (WithStatus a) = mimeRender contentTypeProxy a + +instance {-# OVERLAPPING #-} MimeUnrender JSON a => MimeUnrender JSON (WithStatus _status a) where + mimeUnrender contentTypeProxy input = WithStatus <$> mimeUnrender contentTypeProxy input + +instance {-# OVERLAPPING #-} MimeUnrender PlainText a => MimeUnrender PlainText (WithStatus _status a) where + mimeUnrender contentTypeProxy input = WithStatus <$> mimeUnrender contentTypeProxy input + +instance {-# OVERLAPPING #-} MimeUnrender FormUrlEncoded a => MimeUnrender FormUrlEncoded (WithStatus _status a) where + mimeUnrender contentTypeProxy input = WithStatus <$> mimeUnrender contentTypeProxy input + +instance {-# OVERLAPPING #-} MimeUnrender OctetStream a => MimeUnrender OctetStream (WithStatus _status a) where + mimeUnrender contentTypeProxy input = WithStatus <$> mimeUnrender contentTypeProxy input diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/Links.hs new/servant-0.18.3/src/Servant/Links.hs --- old/servant-0.18.2/src/Servant/Links.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/Links.hs 2001-09-09 03:46:40.000000000 +0200 @@ -17,6 +17,7 @@ -- >>> :set -XDataKinds -XTypeFamilies -XTypeOperators -- >>> import Servant.API -- >>> import Servant.Links +-- >>> import Web.HttpApiData (toUrlPiece) -- >>> import Data.Proxy -- >>> -- >>> type Hello = "hello" :> Get '[JSON] Int @@ -177,6 +178,7 @@ import Servant.API.Sub (type (:>)) import Servant.API.TypeLevel +import Servant.API.UVerb import Servant.API.Vault (Vault) import Servant.API.Verbs @@ -575,6 +577,11 @@ type MkLink (Stream m status fr ct a) r = r toLink toA _ = toA +-- UVerb instances +instance HasLink (UVerb m ct a) where + type MkLink (UVerb m ct a) r = r + toLink toA _ = toA + -- AuthProtext instances instance HasLink sub => HasLink (AuthProtect tag :> sub) where type MkLink (AuthProtect tag :> sub) a = MkLink sub a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/src/Servant/Test/ComprehensiveAPI.hs new/servant-0.18.3/src/Servant/Test/ComprehensiveAPI.hs --- old/servant-0.18.2/src/Servant/Test/ComprehensiveAPI.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/src/Servant/Test/ComprehensiveAPI.hs 2001-09-09 03:46:40.000000000 +0200 @@ -48,7 +48,7 @@ type ComprehensiveAPIWithoutStreamingOrRaw' endpoint = GET :<|> "get-int" :> Get '[JSON] Int - :<|> "capture" :> Capture' '[Description "example description"] "foo" Int :> GET + :<|> "capture" :> Capture' '[Description "example description"] "bar" Int :> GET :<|> "capture-lenient" :> Capture' '[Lenient] "foo" Int :> GET :<|> "header" :> Header "foo" Int :> GET :<|> "header-lenient" :> Header' '[Required, Lenient] "bar" Int :> GET diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/test/Servant/API/StreamSpec.hs new/servant-0.18.3/test/Servant/API/StreamSpec.hs --- old/servant-0.18.2/test/Servant/API/StreamSpec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/test/Servant/API/StreamSpec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -90,7 +90,7 @@ runRenderFrames f = fmap mconcat . runExcept . runSourceT . f . source runUnrenderFrames :: (SourceT Identity b -> SourceT Identity a) -> [b] -> [Either String a] -runUnrenderFrames f = go . Effect . flip unSourceT return . f . source where +runUnrenderFrames f = go . Effect . (\x -> unSourceT x return) . f . source where go :: StepT Identity a -> [Either String a] go Stop = [] go (Error err) = [Left err] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/servant-0.18.2/test/Servant/LinksSpec.hs new/servant-0.18.3/test/Servant/LinksSpec.hs --- old/servant-0.18.2/test/Servant/LinksSpec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/servant-0.18.3/test/Servant/LinksSpec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -29,6 +29,9 @@ -- Fragment :<|> "say" :> Fragment String :> Get '[JSON] NoContent + -- UVerb + :<|> "uverb-example" :> UVerb 'GET '[JSON] '[WithStatus 200 NoContent] + -- All of the verbs :<|> "get" :> Get '[JSON] NoContent :<|> "put" :> Put '[JSON] NoContent @@ -73,6 +76,10 @@ ["roads", "lead", "to", "rome"] `shouldBeLink` "all/roads/lead/to/rome" + it "generated correct links for UVerbs" $ do + apiLink (Proxy :: Proxy ("uverb-example" :> UVerb 'GET '[JSON] '[WithStatus 200 NoContent])) + `shouldBeLink` "uverb-example" + it "generates correct links for query flags" $ do let l1 = Proxy :: Proxy ("balls" :> QueryFlag "bouncy" :> QueryFlag "fast" :> Delete '[JSON] NoContent)
