diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 007b257..d2b1efa 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci 'github' 'cobot-io.cabal' +# haskell-ci 'github' 'cabal.project' # # To regenerate the script (for example after adjusting tested-with) run # @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.16.6 +# version: 0.17.20231110 # -# REGENDATA ("0.16.6",["github","cobot-io.cabal"]) +# REGENDATA ("0.17.20231110",["github","cabal.project"]) # name: Haskell-CI on: @@ -32,11 +32,26 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.8.1 + compilerKind: ghc + compilerVersion: 9.8.1 + setup-method: ghcup + allow-failure: true + - compiler: ghc-9.6.3 + compilerKind: ghc + compilerVersion: 9.6.3 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.2.8 compilerKind: ghc compilerVersion: 9.2.8 setup-method: ghcup - allow-failure: true + allow-failure: false - compiler: ghc-9.0.2 compilerKind: ghc compilerVersion: 9.0.2 @@ -54,10 +69,10 @@ jobs: apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -69,11 +84,13 @@ jobs: echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" @@ -168,6 +185,9 @@ jobs: echo "package cobot-io" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <=9.2 +allow-failures: >=9.8 local-ghc-options: -Wall -Werror -fkeep-going diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..d868753 --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +packages: *.cabal + +allow-newer: hyraxAbif:text, hyraxAbif:bytestring diff --git a/package.yaml b/package.yaml index 2f66d39..1c45c4d 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: cobot-io -version: 0.1.5.2 +version: 0.1.5.3 github: "biocad/cobot-io" license: BSD3 category: Bio @@ -23,10 +23,9 @@ tested-with: | GHC ==8.10.7 || ==9.0.2 || ==9.2.8 - -# hyraxAbif does not support text >= 1.3 yet -# || ==9.4.5 -# || ==9.6.2 + || ==9.4.8 + || ==9.6.3 + || ==9.8.1 # Metadata used when publishing your package @@ -40,11 +39,11 @@ dependencies: - array >= 0.5 && < 0.6 - attoparsec >= 0.10 && < 0.15 - binary >= 0.8.3.0 && < 1.0 -- bytestring >= 0.10.8.1 && < 0.12 +- bytestring >= 0.10.8.1 && < 0.13 - cobot >= 0.1.1.7 - containers >= 0.5.7.1 && < 0.7 - data-msgpack >= 0.0.9 && < 0.1 -- deepseq >= 1.4 && < 1.5 +- deepseq >= 1.4 && < 1.6 - filepath - http-conduit >= 2.3 && < 2.4 - hyraxAbif >= 0.2.3.27 && < 0.2.5.0 @@ -54,7 +53,7 @@ dependencies: - mtl >= 2.2.1 && < 2.4 - parser-combinators >= 1.2.1 - split -- text >= 1.2.2.1 && < 2.1 +- text >= 1.2.2.1 && < 2.2 - vector library: @@ -97,9 +96,7 @@ tests: - cobot-io - directory - QuickCheck >= 2.9.2 && < 2.15 - - hspec >= 2.4.1 && < 2.11 + - hspec >= 2.4.1 && < 2.12 - neat-interpolation >= 0.3 - linear -# megaparsec-9.3 changed something in error messages -# so that our tests do not pass. - - megaparsec < 9.3 + - megaparsec diff --git a/src/Bio/Uniprot/Parser.hs b/src/Bio/Uniprot/Parser.hs index 51cbb12..aa1d1ad 100644 --- a/src/Bio/Uniprot/Parser.hs +++ b/src/Bio/Uniprot/Parser.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -9,8 +10,13 @@ module Bio.Uniprot.Parser where import Prelude hiding (null) import qualified Prelude as P (concat, init, last, null, tail) -import Bio.Uniprot.Type +#if MIN_VERSION_base(4, 18, 0) +import Control.Applicative ((<|>)) +#else import Control.Applicative (liftA2, (<|>)) +#endif + +import Bio.Uniprot.Type import Control.Monad (unless) import Data.Attoparsec.Text import Data.Bifunctor (second) diff --git a/test/FASTASpec.hs b/test/FASTASpec.hs index 38bd83b..619e4a0 100644 --- a/test/FASTASpec.hs +++ b/test/FASTASpec.hs @@ -2,15 +2,18 @@ module FASTASpec where -import Bio.FASTA (fastaP, fromFile, toFile) -import Bio.FASTA.Parser (parseOnly) -import Bio.FASTA.Type (Fasta, FastaItem (..)) -import Bio.Sequence (bareSequence) -import Control.Monad.IO.Class (liftIO) -import Data.Text.IO (readFile) -import Prelude hiding (readFile, writeFile) -import System.Directory (removeFile) -import Test.Hspec +import Control.Monad.IO.Class (liftIO) +import Data.Bifunctor (first) +import qualified Data.Text as T +import Data.Text.IO (readFile) +import Prelude hiding (readFile, writeFile) +import System.Directory (removeFile) +import Test.Hspec + +import Bio.FASTA (fastaP, fromFile, toFile) +import Bio.FASTA.Parser (parseOnly) +import Bio.FASTA.Type (Fasta, FastaItem (..)) +import Bio.Sequence (bareSequence) correctFasta1 :: Fasta Char correctFasta1 = [ FastaItem "3HMX:A|PDBID|CHAIN|SEQUENCE" (bareSequence "IWELKKDVYVVELDWYPDAPGEMVVLTCDTPEEDGITWTLDQSSEVLGSGKTLTIQVKEFGDAGQYTCHKGGEVLSHSLL") @@ -70,7 +73,7 @@ parseBadFile path cf = it ("correctly parses bad fasta from file " <> path) $ do res <- liftIO (readFile path) let badRes = parseOnly fastaP res - badRes `shouldBe` cf + noSpaces badRes `shouldBe` noSpaces cf writeFile :: FilePath -> Fasta Char -> Spec writeFile path cf = @@ -79,3 +82,7 @@ writeFile path cf = fasta <- fromFile path removeFile path fasta `shouldBe` cf + +-- | megaparsec >= 9.3 added more spaces to error messages, so that our old ones do not match. +noSpaces :: Either String a -> Either String a +noSpaces = first $ T.unpack . T.replace " " "" . T.pack