Skip to content

Commit

Permalink
Kill doctest (#6647)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Nov 10, 2024
1 parent 2f28e0d commit c23a4d8
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 51 deletions.
6 changes: 0 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ if impl(ghc < 9.0) || os(windows)
-- won't actually build it.
allow-older: plutus-cert:base

if os(windows)
-- Exclude tests that use `doctest`. They will not work for
-- cross compilation and `cabal` will not be able to make a plan.
package prettyprinter-configurable
tests: False

-- Recently introduced flag to be clever and use SIMD instructions.
-- We don't need this and it causes problems in a few settings including
-- cross-compilation.
Expand Down
9 changes: 0 additions & 9 deletions doc/docusaurus/static/code/BasicPlutusTx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ import PlutusTx.Builtins
-- The Plutus Tx Prelude, discussed further below.
import PlutusTx.Prelude

-- Setup for doctest examples.

-- $setup
-- >>> import Tutorial.PlutusTx
-- >>> import PlutusTx
-- >>> import PlutusCore
-- >>> import PlutusCore.Evaluation.Machine.Ck
-- >>> import Data.Text.Prettyprint.Doc

-- BLOCK2
integerOne :: CompiledCode Integer
{- 'compile' turns the 'TExpQ Integer' into a
Expand Down
5 changes: 0 additions & 5 deletions nix/project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ let
#plutus-metatheory.package.ghcOptions = "-Werror";
plutus-tx.ghcOptions = [ "-Werror" ];
plutus-tx-plugin.ghcOptions = [ "-Werror" ];
# This package's tests require doctest, which generates Haskell source
# code. However, it does not add derivation strategies in said code,
# which will fail the build with -Werror. Furthermore, barring an
# upstream fix, there's nothing we can do about it other than
# disabling -Werror on it.
prettyprinter-configurable.ghcOptions = [ "-Werror" ];
};
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ module PlutusCore.Evaluation.Machine.Ck
, evaluateCk
, evaluateCkNoEmit
, readKnownCk
-- Exported to make doctests work.
, Frame (..)
, transferSpine
) where

import PlutusPrelude
Expand Down
11 changes: 5 additions & 6 deletions plutus-tx/plutus-tx.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ library plutus-tx-testlib
, text

test-suite plutus-tx-test
import: lang
import: lang

if (impl(ghcjs) || os(windows))
buildable: False

type: exitcode-stdio-1.0
main-is: Spec.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
type: exitcode-stdio-1.0
main-is: Spec.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
other-modules:
Blueprint.Definition.Fixture
Blueprint.Definition.Spec
Expand All @@ -203,8 +203,7 @@ test-suite plutus-tx-test
Rational.Laws.Serialization
Show.Spec

hs-source-dirs: test
build-tool-depends: doctest:doctest
hs-source-dirs: test
build-depends:
, aeson
, base >=4.9 && <5
Expand Down
6 changes: 0 additions & 6 deletions plutus-tx/src/PlutusTx/Prelude.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
-- editorconfig-checker-disable-file
-- Need some extra imports from the Prelude for doctests, annoyingly
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
{-# OPTIONS_GHC -fmax-simplifier-iterations=0 #-}

module PlutusTx.Prelude (
-- $prelude
-- * Classes
module Eq,
module Enum,
Expand Down Expand Up @@ -188,10 +186,6 @@ import Prelude qualified as Haskell (return, (=<<), (>>), (>>=))
-- import PlutusTx.Prelude
-- @

-- $setup
-- >>> :set -XNoImplicitPrelude
-- >>> import PlutusTx.Prelude

{-# INLINABLE check #-}
-- | Checks a 'Bool' and aborts if it is false.
check :: Bool -> BI.BuiltinUnit
Expand Down
16 changes: 0 additions & 16 deletions prettyprinter-configurable/src/Text/PrettyBy/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -827,19 +827,3 @@ deriving via PrettyCommon (Maybe a)
newtype PrettyAny a = PrettyAny
{ unPrettyAny :: a
}

-- $setup
--
-- (Definitions for the doctests)
--
-- >>> :set -XDataKinds
-- >>> :set -XDeriveFunctor
-- >>> :set -XDerivingVia
-- >>> :set -XFlexibleContexts
-- >>> :set -XFlexibleInstances
-- >>> :set -XGeneralizedNewtypeDeriving
-- >>> :set -XMultiParamTypeClasses
-- >>> :set -XOverloadedStrings
-- >>> :set -XStandaloneDeriving
-- >>> :set -XTypeFamilies
-- >>> :set -XUndecidableInstances

1 comment on commit c23a4d8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: c23a4d8 Previous: 2f28e0d Ratio
validation-escrow-redeem_2-2 579.4 μs 541.8 μs 1.07
validation-escrow-redeem_2-3 578.6 μs 408.5 μs 1.42
validation-future-increase-margin-1 271.6 μs 251.3 μs 1.08
validation-future-increase-margin-2 765 μs 586.2 μs 1.31
validation-future-increase-margin-3 764 μs 644.9 μs 1.18
validation-future-increase-margin-4 687.7 μs 605.1 μs 1.14
validation-game-sm-success_2-2 262.3 μs 202.2 μs 1.30
validation-decode-auction_1-1 275.1 μs 195.4 μs 1.41
validation-decode-auction_1-2 771.3 μs 537.5 μs 1.43
validation-decode-auction_1-3 772.3 μs 551.4 μs 1.40
validation-decode-auction_1-4 279.5 μs 195.6 μs 1.43
validation-decode-auction_2-1 274.2 μs 192.6 μs 1.42
validation-decode-auction_2-2 759.9 μs 550.4 μs 1.38
validation-decode-auction_2-3 644.9 μs 550.4 μs 1.17
validation-decode-auction_2-5 205.9 μs 195.3 μs 1.05
validation-decode-crowdfunding-success-2 246 μs 229.8 μs 1.07
validation-decode-crowdfunding-success-3 246.4 μs 229.9 μs 1.07
validation-decode-currency-1 248.3 μs 232.3 μs 1.07
validation-decode-escrow-redeem_1-2 325.1 μs 307.7 μs 1.06
validation-decode-escrow-redeem_2-1 328.8 μs 308 μs 1.07
validation-decode-escrow-redeem_2-2 328.4 μs 306.7 μs 1.07
validation-decode-future-increase-margin-2 328.5 μs 309.7 μs 1.06
validation-decode-future-increase-margin-4 714.4 μs 656.5 μs 1.09
validation-decode-game-sm-success_1-3 739.8 μs 521.3 μs 1.42
validation-decode-game-sm-success_1-4 232.1 μs 164.3 μs 1.41
validation-decode-game-sm-success_2-1 733.7 μs 527.8 μs 1.39
validation-decode-game-sm-success_2-2 232.6 μs 165 μs 1.41
validation-decode-game-sm-success_2-3 750.3 μs 535.1 μs 1.40
validation-decode-game-sm-success_2-4 232.3 μs 165 μs 1.41
validation-decode-game-sm-success_2-5 732.5 μs 534.3 μs 1.37
validation-decode-game-sm-success_2-6 231.8 μs 168.7 μs 1.37
validation-decode-multisig-sm-1 814.6 μs 594.1 μs 1.37
validation-decode-multisig-sm-2 833.5 μs 593.7 μs 1.40
validation-decode-multisig-sm-3 828.8 μs 594 μs 1.40
validation-decode-multisig-sm-4 833.2 μs 594.1 μs 1.40
validation-decode-multisig-sm-5 833.5 μs 593.9 μs 1.40
validation-decode-multisig-sm-6 832.9 μs 594 μs 1.40
validation-decode-multisig-sm-7 828.9 μs 580.9 μs 1.43
validation-decode-multisig-sm-8 833.6 μs 594.6 μs 1.40
validation-decode-multisig-sm-9 833.1 μs 593.1 μs 1.40
validation-decode-multisig-sm-10 832 μs 594.4 μs 1.40
validation-decode-ping-pong-1 701.8 μs 500 μs 1.40
validation-decode-ping-pong-2 701.7 μs 499.3 μs 1.41
validation-decode-ping-pong_2-1 696.5 μs 498.4 μs 1.40
validation-decode-prism-1 228.3 μs 161.8 μs 1.41
validation-decode-prism-2 750.1 μs 531.7 μs 1.41
validation-decode-prism-3 341.3 μs 236.1 μs 1.45
validation-decode-pubkey-1 233 μs 165.7 μs 1.41
validation-decode-stablecoin_1-1 1209 μs 862.1 μs 1.40
validation-decode-stablecoin_1-2 232.2 μs 158.8 μs 1.46
validation-decode-stablecoin_1-3 1223 μs 850.2 μs 1.44
validation-decode-stablecoin_1-4 178.4 μs 159.3 μs 1.12
validation-decode-stablecoin_1-5 1223 μs 848.6 μs 1.44
validation-decode-stablecoin_1-6 238.2 μs 162.7 μs 1.46
validation-decode-stablecoin_2-1 1209 μs 848.4 μs 1.43
validation-decode-stablecoin_2-2 233 μs 159.7 μs 1.46
validation-decode-stablecoin_2-3 1223 μs 848.4 μs 1.44
validation-decode-stablecoin_2-4 221.9 μs 159.6 μs 1.39
nofib-clausify/formula5 69510 μs 58730 μs 1.18
nofib-knights/4x4 25360 μs 19410 μs 1.31
nofib-knights/6x6 66690 μs 54480 μs 1.22
nofib-queens5x5/bjbt1 107200 μs 89610 μs 1.20
nofib-queens5x5/bjbt2 118800 μs 86880 μs 1.37
nofib-queens5x5/fc 210100 μs 182500 μs 1.15
marlowe-semantics/0000020002010200020101020201000100010001020101020201010000020102 482.8 μs 351.3 μs 1.37
marlowe-semantics/0001000101000000010101000001000001010101010100000001000001010000 661.2 μs 482.2 μs 1.37
marlowe-semantics/0003040402030103010203030303000200000104030002040304020400000102 1532 μs 1116 μs 1.37
marlowe-semantics/004025fd712d6c325ffa12c16d157064192992faf62e0b991d7310a2f91666b8 1201 μs 881.5 μs 1.36
marlowe-semantics/0101010001010101010101000100010100000001010000010001000001000101 1358 μs 985.5 μs 1.38
marlowe-semantics/0101020201010201010200010102000201000201010102000102010201010000 451 μs 331.9 μs 1.36
marlowe-semantics/0101080808040600020306010000000302050807010208060100070207080202 1141 μs 831.5 μs 1.37
marlowe-semantics/0104010200020000040103020102020004040300030304040400010301040303 1155 μs 1070 μs 1.08
marlowe-semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008 1108 μs 780.6 μs 1.42
marlowe-semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63 1558 μs 1095 μs 1.42
marlowe-semantics/238b21364ab5bdae3ddb514d7001c8feba128b4ddcf426852b441f9a9d02c882 452.2 μs 331.7 μs 1.36
marlowe-semantics/2797d7ac77c1b6aff8e42cf9a47fa86b1e60f22719a996871ad412cbe4de78b5 2182 μs 1916 μs 1.14
marlowe-semantics/2cb21612178a2d9336b59d06cbf80488577463d209a453048a66c6eee624a695 1020.9999999999999 μs 852.6 μs 1.20
marlowe-semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d 451.9 μs 332 μs 1.36
marlowe-semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db 696.3 μs 508.1 μs 1.37
marlowe-semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455 936.1 μs 684.5 μs 1.37
marlowe-semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de 1135 μs 825.2 μs 1.38
marlowe-semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479 454.4 μs 332.2 μs 1.37
marlowe-semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a 1243 μs 905.2 μs 1.37
marlowe-semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7 454 μs 330.1 μs 1.38
marlowe-semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c 1528 μs 1110 μs 1.38
marlowe-semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8 1040 μs 756 μs 1.38
marlowe-semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57 590.8 μs 433.7 μs 1.36
marlowe-semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a 544.6 μs 397.7 μs 1.37
marlowe-semantics/53ed4db7ab33d6f907eec91a861d1188269be5ae1892d07ee71161bfb55a7cb7 556.9 μs 405.8 μs 1.37
marlowe-semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e 454.2 μs 331.9 μs 1.37
marlowe-semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce 1156 μs 844.6 μs 1.37
marlowe-semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b 452.4 μs 332.2 μs 1.36
marlowe-semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999 726.8 μs 529.9 μs 1.37
marlowe-semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112 1363 μs 1138 μs 1.20
marlowe-semantics/675d63836cad11b547d1b4cddd498f04c919d4342612accf40913f9ae9419fac 1285 μs 1125 μs 1.14
marlowe-semantics/67ba5a9a0245ee3aff4f34852b9889b8c810fccd3dce2a23910bddd35c503b71 6848 μs 6016 μs 1.14
marlowe-semantics/6d88f7294dd2b5ce02c3dc609bc7715bd508009738401d264bf9b3eb7c6f49c1 732.3 μs 534.5 μs 1.37
marlowe-semantics/70f65b21b77ddb451f3df9d9fb403ced3d10e1e953867cc4900cc25e5b9dec47 1177 μs 857.3 μs 1.37
marlowe-semantics/71965c9ccae31f1ffc1d85aa20a356d4ed97a420954018d8301ec4f9783be0d7 712.3 μs 521.3 μs 1.37
marlowe-semantics/74c67f2f182b9a0a66c62b95d6fac5ace3f7e71ea3abfc52ffbe3ecb93436ea2 1182 μs 864.8 μs 1.37
marlowe-semantics/7529b206a78becb793da74b78c04d9d33a2540a1abd79718e681228f4057403a 1180 μs 866 μs 1.36
marlowe-role-payout/a92b4072cb8601fa697e1150c08463b14ffced54eb963df08d322216e27373cb 201.7 μs 184.5 μs 1.09
marlowe-role-payout/af2e072b5adfaa7211e0b341e1f7319c4f4e7364a4247c9247132a927e914753 291.8 μs 214.4 μs 1.36
marlowe-role-payout/b6243a5b4c353ce4852aa41705111d57867d2783eeef76f6d59beb2360da6e90 325.7 μs 246.2 μs 1.32
marlowe-role-payout/c78eeba7681d2ab51b4758efa4c812cc041928837c6e7563d8283cce67ce2e02 240.5 μs 195.1 μs 1.23
marlowe-role-payout/c99ecc2146ce2066ba6dffc734923264f8794815acbc2ec74c2c2c42ba272e4d 320.9 μs 224.7 μs 1.43
marlowe-role-payout/caa409c40e39aed9b0f59214b4baa178c375526dea6026b4552b88d2cc729716 248.7 μs 175.5 μs 1.42
marlowe-role-payout/cb2ab8e22d1f64e8d204dece092e90e9bf1fa8b2a6e9cba5012dbe4978065832 264.6 μs 185.8 μs 1.42
marlowe-role-payout/cc1e82927f6c65b3e912200ae30588793d2066e1d4a6627c21955944ac9bd528 297.5 μs 208.9 μs 1.42
marlowe-role-payout/d5cda74eb0947e025e02fb8ed365df39d0a43e4b42cd3573ac2d8fcb29115997 286.5 μs 201.5 μs 1.42
marlowe-role-payout/d6bc8ac4155e22300085784148bbc9d9bbfea896e1009dd396610a90e3943032 298.2 μs 209.7 μs 1.42
marlowe-role-payout/da353bf9219801fa1bf703fc161497570954e9af7e10ffe95c911a9ef97e77bd 268.5 μs 189 μs 1.42
marlowe-role-payout/dc45c5f1b700b1334db99f50823321daaef0e6925b9b2fabbc9df7cde65af62e 268.7 μs 188.8 μs 1.42
marlowe-role-payout/df487b2fd5c1583fa33644423849bc1ab5f02f37edc0c235f34ef01cb12604f6 271.3 μs 190 μs 1.43
marlowe-role-payout/eabeeae18131af89fa57936c0e9eb8d2c7adba534f7e1a517d75410028fa0d6c 261.8 μs 184 μs 1.42
marlowe-role-payout/ec4712ee820eb959a43ebedfab6735f2325fa52994747526ffd2a4f4f84dd58e 297.3 μs 208.9 μs 1.42
marlowe-role-payout/ee3962fbd7373360f46decef3c9bda536a0b1daf6cda3b8a4bcfd6deeb5b4c53 295.6 μs 207.9 μs 1.42
marlowe-role-payout/f1a1e6a487f91feca5606f72bbb1e948c71abf043c6a0ea83bfea9ec6a0f08d8 259.1 μs 182.2 μs 1.42
marlowe-role-payout/f2932e4ca4bbb94b0a9ffbe95fcb7bd5639d9751d75d56d5e14efa5bbed981df 257.6 μs 180.9 μs 1.42
marlowe-role-payout/f53e8cafe26647ccce51e4c31db13608aea1f39034c0f52dee2e5634ef66e747 284.5 μs 199.7 μs 1.42
marlowe-role-payout/f7275afb60e33a550df13a132102e7e925dd28965a4efbe510a89b077ff9417f 261.8 μs 184.2 μs 1.42
marlowe-role-payout/fc8c5f45ffcdb024c21e0f34b22c23de8045a94d5e1a5bda1555c45ddb059f82 271.1 μs 197.1 μs 1.38
marlowe-role-payout/ff38b1ec89952d0247630f107a90cbbeb92ecbfcd19b284f60255718e4ec7548 296.4 μs 225.7 μs 1.31

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.