From 624158d67885f5b3e9a574f70d295e86b06a0671 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Mon, 21 Jun 2021 03:01:05 +0530 Subject: [PATCH] Remove doctests Should use cabal-docspec instead. --- .github/workflows/haskell.yml | 9 --------- .packcheck.ignore | 1 + Setup.hs | 4 ++-- cabal.project.doctest | 2 ++ docs/Setup.hs | 4 ++-- docs/doctests.hs | 28 ---------------------------- docs/streamly-docs.cabal | 20 +------------------- doctests.hs | 28 ---------------------------- streamly.cabal | 29 +---------------------------- 9 files changed, 9 insertions(+), 116 deletions(-) create mode 100644 cabal.project.doctest delete mode 100644 docs/doctests.hs delete mode 100644 doctests.hs diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index ea55ce124..4d9ec97b7 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -59,7 +59,6 @@ jobs: - 8.6.5+fusion-plugin - 8.6.5+streamk - 8.4.4+debug - - doctests cabal_version: ["3.4"] include: - name: 9.0.1 @@ -116,14 +115,6 @@ jobs: cabal_project: cabal.project cabal_build_options: "--flag debug --flag -opt" runner: ubuntu-latest - - name: doctests - ghc_version: 8.8.3 - build: cabal-v2 - cabal_build_options: "--flag doctests" - cabal_build_targets: doctests - disable_sdist_build: "y" - disable_dist_checks: "y" - runner: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.packcheck.ignore b/.packcheck.ignore index c3053d709..5ece005de 100644 --- a/.packcheck.ignore +++ b/.packcheck.ignore @@ -2,6 +2,7 @@ cabal.project cabal.project.ci cabal.project.coverage +cabal.project.doctest cabal.project.hpc-coveralls hie.yaml stack.yaml diff --git a/Setup.hs b/Setup.hs index 26210cdbe..54f57d6f1 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,6 +1,6 @@ module Main (main) where -import Distribution.Extra.Doctest (defaultMainAutoconfWithDoctests) +import Distribution.Simple main :: IO () -main = defaultMainAutoconfWithDoctests "doctests" +main = defaultMainWithHooks autoconfUserHooks diff --git a/cabal.project.doctest b/cabal.project.doctest new file mode 100644 index 000000000..4ec3f1dfb --- /dev/null +++ b/cabal.project.doctest @@ -0,0 +1,2 @@ +packages: streamly.cabal + , docs/streamly-docs.cabal diff --git a/docs/Setup.hs b/docs/Setup.hs index 90d4e1c8d..6fa548caf 100644 --- a/docs/Setup.hs +++ b/docs/Setup.hs @@ -1,6 +1,6 @@ module Main (main) where -import Distribution.Extra.Doctest (defaultMainWithDoctests) +import Distribution.Simple main :: IO () -main = defaultMainWithDoctests "streamly-docs-doctests" +main = defaultMain diff --git a/docs/doctests.hs b/docs/doctests.hs deleted file mode 100644 index 72e3b8a1a..000000000 --- a/docs/doctests.hs +++ /dev/null @@ -1,28 +0,0 @@ -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import System.Environment.Compat (getArgs, unsetEnv) -import Test.DocTest (doctest) - -import qualified Data.List as List - -main :: IO () -main = do - cliArgs <- getArgs - let (cliArgs1, mods) = - if (List.null (filter (== "--modules") cliArgs)) - then (cliArgs, module_sources) - else (List.delete "--modules" cliArgs, []) - let args = - [ "-outputdir=./_doctests/" - , "-fobject-code" - , "--fast" - ] - ++ cliArgs1 - ++ flags - ++ pkgs - ++ mods - traverse_ putStrLn args - unsetEnv "GHC_ENVIRONMENT" - doctest args diff --git a/docs/streamly-docs.cabal b/docs/streamly-docs.cabal index d196172c3..b85ee3015 100644 --- a/docs/streamly-docs.cabal +++ b/docs/streamly-docs.cabal @@ -9,12 +9,7 @@ name: streamly-docs version: 0.0.0 synopsis: Documentation for Streamly description: Documentation for Streamly -build-type: Custom -custom-setup - setup-depends: - base >= 4 && <5, - cabal-doctest >= 1 && <1.1, - Cabal >= 2.2 && < 4 +build-type: Simple ------------------------------------------------------------------------------- -- Library @@ -33,16 +28,3 @@ library base >= 4.9 && < 5 , transformers >= 0.4 && < 0.6 , streamly - -test-suite streamly-docs-doctests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - ghc-options: -Wall - hs-source-dirs: . - main-is: doctests.hs - autogen-modules: Build_doctests - build-depends: - base - , base-compat >= 0.10.5 && < 0.12 - , doctest >= 0.15 && < 0.19 - , streamly-docs diff --git a/doctests.hs b/doctests.hs deleted file mode 100644 index 72e3b8a1a..000000000 --- a/doctests.hs +++ /dev/null @@ -1,28 +0,0 @@ -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import System.Environment.Compat (getArgs, unsetEnv) -import Test.DocTest (doctest) - -import qualified Data.List as List - -main :: IO () -main = do - cliArgs <- getArgs - let (cliArgs1, mods) = - if (List.null (filter (== "--modules") cliArgs)) - then (cliArgs, module_sources) - else (List.delete "--modules" cliArgs, []) - let args = - [ "-outputdir=./_doctests/" - , "-fobject-code" - , "--fast" - ] - ++ cliArgs1 - ++ flags - ++ pkgs - ++ mods - traverse_ putStrLn args - unsetEnv "GHC_ENVIRONMENT" - doctest args diff --git a/streamly.cabal b/streamly.cabal index 5848936d3..cdc823df2 100644 --- a/streamly.cabal +++ b/streamly.cabal @@ -45,7 +45,7 @@ category: Logic, Non-determinism, Parsing, Array, Time, Unicode, Filesystem, Network stability: Stable -build-type: Custom +build-type: Configure extra-source-files: .circleci/config.yml @@ -190,17 +190,6 @@ flag opt manual: True default: True -flag doctests - description: Build doctests test suite - manual: True - default: False - -custom-setup - setup-depends: - base >= 4 && <5, - cabal-doctest >= 1 && <1.1, - Cabal >= 2.2 && < 4 - ------------------------------------------------------------------------------- -- Common stanzas ------------------------------------------------------------------------------- @@ -540,19 +529,3 @@ library -- tests fail if flag(dev) && flag(inspection) build-depends: inspection-and-dev-flags-cannot-be-used-together - -test-suite doctests - type: exitcode-stdio-1.0 - main-is: doctests.hs - if flag(doctests) - build-depends: - base - , base-compat >= 0.10.5 && < 0.12 - , doctest >= 0.15 && < 0.19 - , streamly - else - buildable: False - - ghc-options: -Wall -threaded - hs-source-dirs: . - default-language: Haskell2010