From bc78ae98bff0dd73af5c029fd1aeff2173218fbc Mon Sep 17 00:00:00 2001 From: Yuriy Syrovetskiy <63495+cblp@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:48:46 +0300 Subject: [PATCH] Remove deprected aeson-compat and unused dependencies (#52) * Remove deprected aeson-compat and unused dependencies * Use Ubuntu 20 for GitHub Actions --- .github/workflows/haskell-ci.yml | 2 +- package.yaml | 7 ------- src/Sos/Rule.hs | 6 ++---- steeloverseer.cabal | 19 +++---------------- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index eac62d4..f1c9dcb 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -19,7 +19,7 @@ on: jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 timeout-minutes: 60 container: diff --git a/package.yaml b/package.yaml index bd08d52..1c241bc 100644 --- a/package.yaml +++ b/package.yaml @@ -39,16 +39,13 @@ default-extensions: - ViewPatterns dependencies: - - aeson-compat >= 0.3.10 - async >= 2.0 - base >= 4.0 && < 5.0 - bytestring >= 0.10 - exceptions - fsnotify >= 0.3 && < 0.4 - managed >= 1.0.1 - - mtl >= 2.2 - regex-tdfa >= 1.2 - - semigroups >= 0.16 - stm >= 2.4 - streaming >= 0.1.0 && < 0.3 - text >= 1.2 @@ -59,7 +56,6 @@ library: dependencies: - aeson >= 0.8 - ansi-terminal >= 0.6.2 - - containers >= 0.5 - process >= 1.6 && < 1.7 - unix other-modules: [] @@ -74,9 +70,6 @@ executables: - filepath >= 1.3 - optparse-applicative >= 0.11 other-modules: [] - when: - - condition: os(darwin) - dependencies: hfsevents >= 0.1.3 ghc-options: -threaded tests: diff --git a/src/Sos/Rule.hs b/src/Sos/Rule.hs index 2ddb29c..1905a9d 100644 --- a/src/Sos/Rule.hs +++ b/src/Sos/Rule.hs @@ -11,12 +11,11 @@ import Sos.Template import Control.Applicative import Control.Monad.Catch (MonadThrow, throwM) -import Data.Aeson.Compat ((.:), FromJSON(..), Parser, Value(..)) -import Data.Aeson.Types (typeMismatch) +import Data.Aeson ((.:), FromJSON(..), Value(..)) +import Data.Aeson.Types (Parser, typeMismatch) import Data.ByteString (ByteString) import Data.ByteString.Internal (c2w) import Data.Either -import Data.Text (Text) import Text.Regex.TDFA import Text.Regex.TDFA.ByteString (compile) @@ -118,7 +117,6 @@ instance FromJSON RawRule where parseCommands :: Parser [RawTemplate] parseCommands = go ["command", "commands"] - go :: [Text] -> Parser [ByteString] go = fmap (map Text.encodeUtf8 . listify) . asum . map (o .:) parseJSON v = typeMismatch "command" v diff --git a/steeloverseer.cabal b/steeloverseer.cabal index 72df4a0..0e7cb46 100644 --- a/steeloverseer.cabal +++ b/steeloverseer.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.0. +-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack @@ -55,19 +55,15 @@ library hspec-discover:hspec-discover build-depends: aeson >=0.8 - , aeson-compat >=0.3.10 , ansi-terminal >=0.6.2 , async >=2.0 , base >=4.0 && <5.0 , bytestring >=0.10 - , containers >=0.5 , exceptions , fsnotify ==0.3.* , managed >=1.0.1 - , mtl >=2.2 , process ==1.6.* , regex-tdfa >=1.2 - , semigroups >=0.16 , stm >=2.4 , streaming >=0.1.0 && <0.3 , text >=1.2 @@ -94,8 +90,7 @@ executable sos build-tool-depends: hspec-discover:hspec-discover build-depends: - aeson-compat >=0.3.10 - , async >=2.0 + async >=2.0 , base >=4.0 && <5.0 , bytestring >=0.10 , directory >=1.2 @@ -103,19 +98,14 @@ executable sos , filepath >=1.3 , fsnotify ==0.3.* , managed >=1.0.1 - , mtl >=2.2 , optparse-applicative >=0.11 , regex-tdfa >=1.2 - , semigroups >=0.16 , steeloverseer , stm >=2.4 , streaming >=0.1.0 && <0.3 , text >=1.2 , yaml >=0.8 default-language: Haskell2010 - if os(darwin) - build-depends: - hfsevents >=0.1.3 test-suite spec type: exitcode-stdio-1.0 @@ -140,17 +130,14 @@ test-suite spec build-tool-depends: hspec-discover:hspec-discover build-depends: - aeson-compat >=0.3.10 - , async >=2.0 + async >=2.0 , base >=4.0 && <5.0 , bytestring >=0.10 , exceptions , fsnotify ==0.3.* , hspec , managed >=1.0.1 - , mtl >=2.2 , regex-tdfa >=1.2 - , semigroups >=0.16 , steeloverseer , stm >=2.4 , streaming >=0.1.0 && <0.3