From 50e5a6f75b7a870f51c66a2c33725a6c2e4640b5 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Thu, 20 Jun 2024 15:51:55 +0200 Subject: [PATCH 01/18] Add a wrapper for quarto markdown rendering This wrapper uses quarto to render R quarto markdown .qmd notebooks. R dependency handling with conda or renv is supported. --- utils/quarto/environment.linux-64.pin.txt | 172 +++++++++++++++++++ utils/quarto/environment.yaml | 35 ++++ utils/quarto/meta.yaml | 42 +++++ utils/quarto/test/.gitignore | 9 + utils/quarto/test/Snakefile | 147 ++++++++++++++++ utils/quarto/test/env/extra.linux-64.pin.txt | 139 +++++++++++++++ utils/quarto/test/env/extra.yaml | 6 + utils/quarto/test/extra_datatable.qmd | 12 ++ utils/quarto/test/full.qmd | 15 ++ utils/quarto/test/simple.qmd | 7 + utils/quarto/wrapper.py | 97 +++++++++++ 11 files changed, 681 insertions(+) create mode 100644 utils/quarto/environment.linux-64.pin.txt create mode 100644 utils/quarto/environment.yaml create mode 100644 utils/quarto/meta.yaml create mode 100644 utils/quarto/test/.gitignore create mode 100644 utils/quarto/test/Snakefile create mode 100644 utils/quarto/test/env/extra.linux-64.pin.txt create mode 100644 utils/quarto/test/env/extra.yaml create mode 100644 utils/quarto/test/extra_datatable.qmd create mode 100644 utils/quarto/test/full.qmd create mode 100644 utils/quarto/test/simple.qmd create mode 100644 utils/quarto/wrapper.py diff --git a/utils/quarto/environment.linux-64.pin.txt b/utils/quarto/environment.linux-64.pin.txt new file mode 100644 index 00000000000..2e7a488176d --- /dev/null +++ b/utils/quarto/environment.linux-64.pin.txt @@ -0,0 +1,172 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +@EXPLICIT +https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81 +https://conda.anaconda.org/conda-forge/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2#19f9db5f4f1b7f5ef5f6d67207f25f38 +https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.6.2-hbcca054_0.conda#847c3c2905cc467cea52c24f9cfa8080 +https://conda.anaconda.org/conda-forge/linux-64/dart-sass-1.58.3-ha770c72_1.conda#d54982a58cd9be3d00a7efe76ba6f60c +https://conda.anaconda.org/conda-forge/linux-64/esbuild-0.19.2-ha770c72_0.conda#8fa87b764cf6143cb66e9cc3548b186a +https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2#0c96522c6bdaed4b1566d11387caaf45 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2#34893075a5c9e55cdafac56607368fc6 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2#4d59c254e01d9cde7957100457e2d5fb +https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_2.conda#cbbe59391138ea5ad3658c76912e147f +https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda#d731b543793afc0433c4fd593e693fce +https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-hf3520f5_7.conda#b80f2f396ca2c28b8c14c437a4ed1e74 +https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-13.2.0-hdb50d1a_111.conda#43178c27fac2dcd495bd9e58e18272d9 +https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-13.2.0-hdb50d1a_111.conda#4ffa92ea4ba6555dee156ce3d0ae7a9b +https://conda.anaconda.org/conda-forge/linux-64/pandoc-3.1.11.1-ha770c72_0.conda#0e2f14aff42adf4675bcd5335d644a5f +https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda#161081fc7cec0bfda0d86d7cb595f8d8 +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2#f766549260d6815b0c52253f1fb1bb29 +https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_11.conda#8c462ced2af33648195dc9459f331f31 +https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda#595db67e32b276298ff3d94d07d47fbf +https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d +https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-ha1999f0_7.conda#3f840c7ed70a96b5ebde8044b2f36f32 +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2#fee5683a3f04bd15cbd8318b096a27ab +https://conda.anaconda.org/conda-forge/linux-64/binutils-2.40-h4852527_7.conda#df53aa8418f8c289ae9b9665986034f8 +https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.40-hb3c18ed_7.conda#ca84cd2dcc3d3e200f8e9aff105cbcb3 +https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_11.conda#0b3b218a596bb4c3854cc9ee799f94e5 +https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4 +https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.28.1-hd590300_0.conda#dcde58ff9a1f30b0037a2315d1846d1f +https://conda.anaconda.org/conda-forge/linux-64/deno-1.37.2-h335b0a9_1.conda#50fe6d0064adfd83846a6f9c87da03e3 +https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.10-h36c2ea0_0.tar.bz2#ac7bc6a654f8f41b352b38f4051135f8 +https://conda.anaconda.org/conda-forge/linux-64/gettext-tools-0.22.5-h59595ed_2.conda#985f2f453fb72408d6b6f1be0f324033 +https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3 +https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 +https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d +https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 +https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-0.22.5-h59595ed_2.conda#172bcc51059416e7ce99e7b528cede83 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_11.conda#c485da4fdb454539f852a90ae06e9bb7 +https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e +https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda#ea25936bb4080d843790b586850f82b8 +https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda#30fd6e37fe21f86f4bd26d6ee73eeec7 +https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_11.conda#eaa8ea74083fb4a78ae19e431e556003 +https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b +https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.4.0-hd590300_0.conda#b26e8aa824079e1be0294e7152ca4559 +https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda#5aa797f8787fe7a17d1b0821485b5adc +https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-h4ab18f5_1.conda#57d7dc60e9325e3de37ff8dffd18e814 +https://conda.anaconda.org/conda-forge/linux-64/m4-1.4.18-h516909a_1001.tar.bz2#4abb931c0d08a41583fc637c663e45e2 +https://conda.anaconda.org/conda-forge/linux-64/make-4.3-hd18ef5c_1.tar.bz2#4049ebfd3190b580dffe76daed26155a +https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h59595ed_0.conda#fcea371545eda051b6deafb24889fc69 +https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.1-h4ab18f5_0.conda#a41fa0e391cc9e0d6b78ac69ca047a6c +https://conda.anaconda.org/conda-forge/linux-64/pkg-config-0.29.2-h36c2ea0_1008.tar.bz2#fbef41ff6a4c8140c30057466a1cdd47 +https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2#22dad4df6e8630e8dff2428f6f6a7036 +https://conda.anaconda.org/conda-forge/linux-64/sed-4.8-he412f7d_0.tar.bz2#7362f0042e95681f5d371c46c83ebd08 +https://conda.anaconda.org/conda-forge/linux-64/xorg-kbproto-1.0.7-h7f98852_1002.tar.bz2#4b230e8381279d76131116660f5a241a +https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.1-hd590300_0.conda#b462a33c0be1421532f28bfe8f4a7514 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.11-hd590300_0.conda#2c80dc38fface310c9bd81b17037fee5 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.3-h7f98852_0.tar.bz2#be93aabceefa2fac576e971aef407908 +https://conda.anaconda.org/conda-forge/linux-64/xorg-renderproto-0.11.1-h7f98852_1002.tar.bz2#06feff3d2634e3097ce2fe681474b534 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xextproto-7.3.0-h0b41bf4_1003.conda#bce9f945da8ad2ae9b1d7165a64d0f87 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007.tar.bz2#b4a4381d54784606820704f7b5f05a15 +https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 +https://conda.anaconda.org/conda-forge/linux-64/deno-dom-0.1.35-hd9586b0_1.conda#263ee0870b18b013d9ec8539113ac69f +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 +https://conda.anaconda.org/conda-forge/linux-64/gmp-6.3.0-h59595ed_1.conda#e358c7c5f6824c272b5034b3816438a7 +https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.13-h59595ed_1003.conda#f87c7b7c2cb45f323ffbce941c78ab7c +https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff +https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2#76bbff344f0134279f225174e9064c8f +https://conda.anaconda.org/conda-forge/linux-64/libasprintf-0.22.5-h661eb56_2.conda#dd197c968bf9760bba0031888d431ede +https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1 +https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-devel-0.22.5-h59595ed_2.conda#b63d9b6da3653179a278077f0de20014 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_11.conda#4c3e460d6acf8e43e4ce8bf405187eb7 +https://conda.anaconda.org/conda-forge/linux-64/libint-2.9.0-h9bbc0ff_0.conda#eb70ffeb6cdb59c11389eba5a02ad9d4 +https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a +https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.43-h2797004_0.conda#009981dd9cfcaa4dbfa25ffaed86bcae +https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-13.2.0-h6ddb7a1_11.conda#3227eb98475de9cb375391aa28b931d5 +https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.46.0-hde9e2c9_0.conda#18aa975d2094c34aef978060ae7da7d8 +https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe +https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.16-hd590300_0.conda#151cba22b85a989c2d6ef9633ffee1e4 +https://conda.anaconda.org/conda-forge/linux-64/llvm-openmp-8.0.1-hc9558a2_0.tar.bz2#67590caab043d6d7ffc371f9cced7848 +https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.44-h0f59acf_0.conda#3914f7ac1761dce57102c72ca7c35d01 +https://conda.anaconda.org/conda-forge/linux-64/perl-5.32.1-7_hd590300_perl5.conda#f2cfec9406850991f4e3d960cc9e3321 +https://conda.anaconda.org/conda-forge/linux-64/pixman-0.43.2-h59595ed_0.conda#71004cbf7924e19c02746ccde9fd7123 +https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 +https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc +https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.4-h7391055_0.conda#93ee23f12bc2e684548181256edd2cf6 +https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda#9653f1bf3766164d0e65fa723cabbc54 +https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda#4d056880988120e29d75bfff282e0f45 +https://conda.anaconda.org/conda-forge/linux-64/autoconf-2.71-pl5321h2b4cb7a_1.conda#50cabb1aee157a18082c7c92cc4b3143 +https://conda.anaconda.org/conda-forge/linux-64/bwidget-1.9.14-ha770c72_1.tar.bz2#5746d6202ba2abad4a4707f2a2462795 +https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda#9ae35c3d96db2c94ce0cef86efdfa2cb +https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-13.2.0-h9eb54c0_11.conda#6ba78509a489a8a7882328468f187cc9 +https://conda.anaconda.org/conda-forge/linux-64/glpk-5.0-h445213a_0.tar.bz2#efc4b0c33bdf47312ad5a8a0587fa653 +https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844 +https://conda.anaconda.org/conda-forge/linux-64/libasprintf-devel-0.22.5-h661eb56_2.conda#02e41ab5834dcdcc8590cf29d9526f50 +https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-h8a4344b_1.conda#9c406bb3d4dac2b358873e6462496d09 +https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.27-pthreads_h413a1c8_0.conda#a356024784da6dfd4683dc5ecf45b155 +https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda#66f03896ffbe1a110ffda05c7a856504 +https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.11.6-h232c23b_0.conda#427a3e59d66cb5d145020bd9c6493334 +https://conda.anaconda.org/conda-forge/linux-64/openmp-8.0.1-0.tar.bz2#b35241079152e5cc891c99368395b2c6 +https://conda.anaconda.org/conda-forge/linux-64/python-3.12.4-h194c7f8_0_cpython.conda#d73490214f536cccb5819e9873048c92 +https://conda.anaconda.org/conda-forge/linux-64/quarto-1.4.550-ha770c72_1.conda#b7b89be76bcdab239f7956e5fc2727ab +https://conda.anaconda.org/conda-forge/linux-64/tktable-2.10-h0c5db8f_5.conda#9464044754ea25557a9c93f0327d90a6 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.9-hb711507_1.conda#4a6d410296d7e39f00bacdee7df046e9 +https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.14.2-h14ed4e7_0.conda#0f69b688f52ff6da70bccb7ff7001d1d +https://conda.anaconda.org/conda-forge/linux-64/gcc-13.2.0-hc7bed06_11.conda#af15e113c65619887dcabd64d40a7897 +https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-13.2.0-h3668938_7.conda#fb11f301f0da4767740b9a0ea6aeb7d6 +https://conda.anaconda.org/conda-forge/linux-64/gettext-0.22.5-h59595ed_2.conda#219ba82e95d7614cf7140d2a4afc0926 +https://conda.anaconda.org/conda-forge/linux-64/gfortran_impl_linux-64-13.2.0-h9efe08d_11.conda#d08f638bb8b62d71f2222ecb7003a995 +https://conda.anaconda.org/conda-forge/linux-64/glib-tools-2.80.2-h73ef956_1.conda#1daf2cc7054ff71b9a05485f2562cbb4 +https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.2.0-h2a599c4_11.conda#c2f0227c9bea564b8edc2f1de939c76d +https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-22_linux64_openblas.conda#1a2a0cd3153464fee6646f3dd6dad9b8 +https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda#f21c27f076a07907e70c49bb57bd0f20 +https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda#cbe1bb1f21567018ce595d9c2be0f0db +https://conda.anaconda.org/conda-forge/noarch/setuptools-70.1.0-pyhd8ed1ab_0.conda#258e66f95f814d51ada2a1fe9274039b +https://conda.anaconda.org/conda-forge/noarch/wheel-0.43.0-pyhd8ed1ab_1.conda#0b5293a157c2b5cd513dd1b03d8d3aae +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.4-h0b41bf4_2.conda#82b6df12252e6f32402b96dacc656fec +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.11-hd590300_0.conda#ed67c36f215b310412b2af935bf3e530 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxt-1.3.0-hd590300_1.conda#ae92aab42726eb29d16488924f7312cb +https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-hbb29018_1.conda#e31a51ddd52326d10a9cc50b0d68daab +https://conda.anaconda.org/conda-forge/linux-64/curl-8.8.0-he654da7_0.conda#042341d8b9ba4ee7f2722b81fae9f0ad +https://conda.anaconda.org/conda-forge/linux-64/gfortran-13.2.0-hc7bed06_11.conda#214466faa9389783bb8a0a468c868e80 +https://conda.anaconda.org/conda-forge/linux-64/glib-2.80.2-h8a4344b_1.conda#dad336abc079b9a38dc10087231619cd +https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-13.2.0-h4ebd915_7.conda#1ed21c271aff2e49de5d0e352b62837e +https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-22_linux64_openblas.conda#b083767b6c877e24ee597d93b87ab838 +https://conda.anaconda.org/conda-forge/noarch/pip-24.0-pyhd8ed1ab_0.conda#f586ac1e56c8638b64f9c8122a7b8a67 +https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.0.0-hf484d3e_0.tar.bz2#5f1c23fd134564eeb5ee730640168c5a +https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-8.5.0-hfac3d4d_0.conda#f5126317dd0ce0ba26945e411ecc6960 +https://conda.anaconda.org/conda-forge/linux-64/pango-1.54.0-h84a9a3c_0.conda#7c51e110b2f059c0843269d3324e4b22 +https://conda.anaconda.org/conda-forge/linux-64/r-base-4.3.3-h8ee917f_2.conda#fdd20aea0c8243bfa7fb85d144f4febe +https://conda.anaconda.org/conda-forge/linux-64/r-base64enc-0.1_3-r43h57805ef_1006.conda#3cb46d4c0d2096491f9934da0e1555ee +https://conda.anaconda.org/conda-forge/linux-64/r-cli-3.6.2-r43ha503ecb_0.conda#7a325f68b1354c1a5261688b5e54d008 +https://conda.anaconda.org/conda-forge/linux-64/r-curl-5.1.0-r43hf9611b0_0.conda#d2a3cc302656e5ff30fc635fd9ef3ae6 +https://conda.anaconda.org/conda-forge/linux-64/r-digest-0.6.35-r43ha503ecb_0.conda#d28a7db9b060ceaf683f0b036780b962 +https://conda.anaconda.org/conda-forge/noarch/r-evaluate-0.24.0-r43hc72bb7e_0.conda#1c3aa7ca297fae40ea8d6a8fe78317f0 +https://conda.anaconda.org/conda-forge/linux-64/r-fastmap-1.2.0-r43ha18555a_0.conda#f60a0e293418fc91b73bd67aa62d4a79 +https://conda.anaconda.org/conda-forge/linux-64/r-fs-1.6.4-r43ha18555a_0.conda#c0cc6b111eb64c8d21f4feeb53c8d06d +https://conda.anaconda.org/conda-forge/linux-64/r-glue-1.7.0-r43h57805ef_0.conda#20e2cb7c0d27bccf8fe21ec5c3897751 +https://conda.anaconda.org/conda-forge/linux-64/r-jsonlite-1.8.8-r43h57805ef_0.conda#fb01953d78a87de6211b1ebccafed273 +https://conda.anaconda.org/conda-forge/linux-64/r-mime-0.12-r43h57805ef_2.conda#348f6adefce6912321b2a2ab0528ae89 +https://conda.anaconda.org/conda-forge/noarch/r-packrat-0.9.2-r43hc72bb7e_0.conda#acc0bee43ed5a63ef521aa6995541e97 +https://conda.anaconda.org/conda-forge/linux-64/r-ps-1.7.6-r43h57805ef_0.conda#48f9e73215aa6de4545ec3ec36e5e534 +https://conda.anaconda.org/conda-forge/noarch/r-r6-2.5.1-r43hc72bb7e_2.conda#79f167972554dc6b65aa099cd85c22a1 +https://conda.anaconda.org/conda-forge/linux-64/r-rappdirs-0.3.3-r43h57805ef_2.conda#788ac4f3dcfa79520bfc9eeadf50c2eb +https://conda.anaconda.org/conda-forge/linux-64/r-rcpp-1.0.12-r43h7df8631_0.conda#a8aac8be0868617b28f27484ea548d6c +https://conda.anaconda.org/conda-forge/noarch/r-renv-1.0.7-r43hc72bb7e_0.conda#efa116dc4d7118a48c97f6f8f4861427 +https://conda.anaconda.org/conda-forge/linux-64/r-rlang-1.1.4-r43ha18555a_0.conda#74c4cb6644843dccabc350cba4b56ec6 +https://conda.anaconda.org/conda-forge/noarch/r-rstudioapi-0.16.0-r43hc72bb7e_0.conda#02c7b3c36e390b0c538300adab8ca3eb +https://conda.anaconda.org/conda-forge/linux-64/r-sys-3.4.2-r43h57805ef_1.conda#ae6e4dd935d9c91064cbca07d2769d75 +https://conda.anaconda.org/conda-forge/linux-64/r-xfun-0.45-r43ha18555a_0.conda#cced29e73709a7c9b2495a4f5d695d66 +https://conda.anaconda.org/conda-forge/linux-64/r-yaml-2.3.8-r43h57805ef_0.conda#41db1ee9d0073339e681379b92e7dfb6 +https://conda.anaconda.org/conda-forge/linux-64/r-askpass-1.2.0-r43h57805ef_0.conda#ee095f1d72a1d80864816e44623ba392 +https://conda.anaconda.org/conda-forge/linux-64/r-cachem-1.1.0-r43hb1dbf0f_0.conda#d48720030e2b1d780389bafa5a9c7536 +https://conda.anaconda.org/conda-forge/linux-64/r-ellipsis-0.3.2-r43h57805ef_2.conda#10c5892991072cfa3a61489d2ac6ad66 +https://conda.anaconda.org/conda-forge/noarch/r-highr-0.11-r43hc72bb7e_0.conda#ecd3b95a01caa7bdcf63714427b5b88c +https://conda.anaconda.org/conda-forge/linux-64/r-later-1.3.2-r43ha503ecb_0.conda#6e120827a341f21444881e84408e98a7 +https://conda.anaconda.org/conda-forge/noarch/r-lifecycle-1.0.4-r43hc72bb7e_0.conda#291d2fb68ea1b181644b40d6743ae000 +https://conda.anaconda.org/conda-forge/linux-64/r-pki-0.1_14-r43hb1dbf0f_0.conda#58c4dc882730c0d96ca09e58be0150d8 +https://conda.anaconda.org/conda-forge/linux-64/r-processx-3.8.4-r43h57805ef_0.conda#660d4e9ff8beef35dbda645484d17a25 +https://conda.anaconda.org/conda-forge/noarch/r-tinytex-0.51-r43hc72bb7e_0.conda#16653f65f1ab934e1a9bdac874f9b63b +https://conda.anaconda.org/conda-forge/linux-64/r-htmltools-0.5.8.1-r43ha503ecb_0.conda#220b9c45f5867a42d49bde8d340e9e53 +https://conda.anaconda.org/conda-forge/noarch/r-knitr-1.47-r43hc72bb7e_0.conda#0310660d998a5933bb4545a312ed7385 +https://conda.anaconda.org/conda-forge/noarch/r-memoise-2.0.1-r43hc72bb7e_2.conda#6520452e207d8f9bab9f21492f88c48b +https://conda.anaconda.org/conda-forge/linux-64/r-openssl-2.2.0-r43hd7d0243_0.conda#60f961514ecc3ee1fd7b1afd6ea853ab +https://conda.anaconda.org/conda-forge/noarch/r-fontawesome-0.5.2-r43hc72bb7e_0.conda#d07f215759462959de39d7232386f1b9 +https://conda.anaconda.org/conda-forge/noarch/r-jquerylib-0.1.4-r43hc72bb7e_2.conda#49a3fad710cbccec9139b36587842f88 +https://conda.anaconda.org/conda-forge/noarch/r-rsconnect-1.3.1-r43hc72bb7e_0.conda#474409574da3aacf988008567cbf11b7 +https://conda.anaconda.org/conda-forge/linux-64/r-sass-0.4.9-r43ha503ecb_0.conda#58e32ad6d979828aa0fc3da59e1b4d78 +https://conda.anaconda.org/conda-forge/noarch/r-bslib-0.7.0-r43hc72bb7e_0.conda#6e2bfdc782284259390d09bb083142b2 +https://conda.anaconda.org/conda-forge/noarch/r-rmarkdown-2.27-r43hc72bb7e_1.conda#4b681e35650d7d10737bc0c6ed80ae9a +https://conda.anaconda.org/conda-forge/noarch/r-quarto-1.4-r43hc72bb7e_0.conda#a86d89513116deba7cc3c6e8e72a0f61 diff --git a/utils/quarto/environment.yaml b/utils/quarto/environment.yaml new file mode 100644 index 00000000000..3fd64e3e467 --- /dev/null +++ b/utils/quarto/environment.yaml @@ -0,0 +1,35 @@ +channels: + - conda-forge + - nodefaults +dependencies: + - r-base + - r-renv + - r-quarto + # This lists fairly excessive + # dependencies that may be used to build + # R packages from source within this environment. + - binutils + - glib + - gettext + - gxx_linux-64 + - gcc_linux-64 + - make + - pkg-config + - libgomp + - zlib + - libblas + - liblapack + - autoconf + - glpk + - gmp + # r xml2: https://github.com/r-lib/xml2/issues/418 + - libxml2==2.11.6 + - gfortran + - openmp + - gettext-tools + - libiconv + - pcre2 + - libint + - packaging + - setuptools + - cxx-compiler diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml new file mode 100644 index 00000000000..ec654468a05 --- /dev/null +++ b/utils/quarto/meta.yaml @@ -0,0 +1,42 @@ +name: quarto +description: Render quarto markdown documents +authors: + -Vito Zanotelli +input: + - script: > + Quarto script to render (.qmd). + - The script must follow the following rules: + - If parameters are used (extra arguments in `input`, `output`, `params`) + they must be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr + - All dependencies used in the script must either be: + - installed in the `renv` declared as `input.renv` (see `input.renv` documentation) + - installed in the conda environment used to run this wrapper. If this is customized, use + the `conda: ` parameter to overwrite the default conda environment. + - renv: > + Optional: + Path a folder containing restored `renv` environment or a file within + (eg `.Rprofile`, `renv.lock`). If this is used the `renv` must + contain a full `quarto` installation. + Note that the R version depends on the conda environment used in the wrapper. + If this needs to be changed, change the `conda:` parameter to point to an + appropriate conda environment. + Default: the project root directory + - ``: > + Additional input files. These the paths will be passed as `params:` to the quarto script + and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr +output: + - report: > + Optional: + Path to the rendered report. The file extension will be used to determine the output format (eg `report.html`, `report.pdf`) + If not provided, the report will be rendered in a temporary directory and no output will be returned. + - `: > + Additional output files. These the paths will be passed as `params:` to the quarto script + and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr +params: + - `: > + Additional parameters to be passed to the quarto script. These the paths will be passed as `params:` to the quarto script + and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr + If wildcards should be passed to the `quarto` script, use a function to pass it in params: + `params: project: lambda wc: wc.project` +notes: | + This wrapper runs \ No newline at end of file diff --git a/utils/quarto/test/.gitignore b/utils/quarto/test/.gitignore new file mode 100644 index 00000000000..03c0d3a687b --- /dev/null +++ b/utils/quarto/test/.gitignore @@ -0,0 +1,9 @@ +example_proj* +logs/ +env/renv_test +*_files/ +*_input.txt +*_output.txt +*.docx +*.html +output/ \ No newline at end of file diff --git a/utils/quarto/test/Snakefile b/utils/quarto/test/Snakefile new file mode 100644 index 00000000000..b6e7c215bac --- /dev/null +++ b/utils/quarto/test/Snakefile @@ -0,0 +1,147 @@ +import os + + +rule all: # [hide] + input: # [hide] + "output/simple.html", # [hide] + "output/simple.docx", # [hide] + "output/example_proj_full.html", # [hide] + "output/example_proj_noreport.txt", # [hide] + "output/extra_datatable_conda.html", # [hide] + "output/extra_datatable_renv.html", # [hide] + + +rule testfile: + output: + touch("{project}_input.txt"), + + +rule render_quarto_full: + input: + script="full.qmd", + input_txt="{project}_input.txt", + output: + report="{project}_full.html", + output_txt="{project}_output.txt", + params: + project=lambda wc: wc.project, + log: + "logs/{project}_html.log", + wrapper: + "master/utils/quarto" + + +rule render_html: + input: + script="simple.qmd", + output: + report="output/simple.html", + log: + "logs/simple_html.log", + wrapper: + "master/utils/quarto" + + +rule render_docx: + input: + script="simple.qmd", + output: + report="output/simple.docx", + log: + "logs/simple_docx.log", + wrapper: + "master/utils/quarto" + + +rule render_quarto_noreport: + input: + script="full.qmd", + input_txt="{project}_input.txt", + output: + output_txt="{project}_noreport.txt", + log: + "logs/{project}_noreport.log", + wrapper: + "master/utils/quarto" + + +rule render_quarto_extra_conda: + conda: + "env/extra.yaml" + input: + script="extra_datatable.qmd", + output: + report="output/extra_datatable_conda.html", + log: + "logs/conda.log", + wrapper: + "master/utils/quarto" + + +# Rules for a example using renv +wildcard_constraints: + # Allows renv_dir also to be the empty (=root dir) + renv_dir=".*", + + +# The `renv_lock` on renv rules is an artificial resource to prevent multiple +# renv operations at the same time, which may cause issues.. +# In such cases restrict it via the +# resources CLI flag: --resources renv_lock=1 + + +rule renv_example_init: + conda: + "../environment.yaml" + output: + rprofile="{renv_dir}/.Rprofile", + lockfile="{renv_dir}/renv.lock", + params: + dependencies="'quarto','data.table'", + resources: + renv_lock=1, + log: + "logs/renv/{renv_dir}_init.log", + shell: + """ + DIRNAME="{wildcards.renv_dir}" + mkdir -p $DIRNAME + cd $DIRNAME + Rscript -e "renv::init();" + # somehow the lockfile needs to be removed + # otherwise renv::install wont work with `Error: package 'data.table' is not available' + rm $(basename {output.lockfile}) + Rscript -e "renv::install(c('data.table', 'quarto'));\ + renv::snapshot(type='all')" + """ + + +rule restore_renv: + conda: + "../environment.yaml" + input: + rprofile="{renv_dir}.Rprofile", + lock="{renv_dir}renv.lock", + output: + restored="{renv_dir}restored.Rprofile", + resources: + renv_lock=1, + log: + "logs/renv/{renv_dir}_restore.log", + shell: + """ + R -e 'source("{input.rprofile}", chdir=TRUE);renv::restore()' + echo 'source("{input.rprofile}", chdir=TRUE)' > {output.restored} + """ + + +rule render_quarto_renv: + input: + script="extra_datatable.qmd", + renv="env/renv_test/restored.Rprofile", + output: + report="output/extra_datatable_renv.html", + log: + "logs/renv.log", + wrapper: + "master/utils/quarto" diff --git a/utils/quarto/test/env/extra.linux-64.pin.txt b/utils/quarto/test/env/extra.linux-64.pin.txt new file mode 100644 index 00000000000..2f0a7ae48a0 --- /dev/null +++ b/utils/quarto/test/env/extra.linux-64.pin.txt @@ -0,0 +1,139 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +@EXPLICIT +https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81 +https://conda.anaconda.org/conda-forge/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2#19f9db5f4f1b7f5ef5f6d67207f25f38 +https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.6.2-hbcca054_0.conda#847c3c2905cc467cea52c24f9cfa8080 +https://conda.anaconda.org/conda-forge/linux-64/dart-sass-1.58.3-ha770c72_1.conda#d54982a58cd9be3d00a7efe76ba6f60c +https://conda.anaconda.org/conda-forge/linux-64/esbuild-0.19.2-ha770c72_0.conda#8fa87b764cf6143cb66e9cc3548b186a +https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2#0c96522c6bdaed4b1566d11387caaf45 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2#34893075a5c9e55cdafac56607368fc6 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2#4d59c254e01d9cde7957100457e2d5fb +https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_2.conda#cbbe59391138ea5ad3658c76912e147f +https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda#d731b543793afc0433c4fd593e693fce +https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-hf3520f5_7.conda#b80f2f396ca2c28b8c14c437a4ed1e74 +https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-13.2.0-hdb50d1a_111.conda#43178c27fac2dcd495bd9e58e18272d9 +https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-13.2.0-hdb50d1a_111.conda#4ffa92ea4ba6555dee156ce3d0ae7a9b +https://conda.anaconda.org/conda-forge/linux-64/pandoc-3.1.11.1-ha770c72_0.conda#0e2f14aff42adf4675bcd5335d644a5f +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2#f766549260d6815b0c52253f1fb1bb29 +https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_11.conda#8c462ced2af33648195dc9459f331f31 +https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda#595db67e32b276298ff3d94d07d47fbf +https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d +https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-ha1999f0_7.conda#3f840c7ed70a96b5ebde8044b2f36f32 +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2#fee5683a3f04bd15cbd8318b096a27ab +https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_11.conda#0b3b218a596bb4c3854cc9ee799f94e5 +https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4 +https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.28.1-hd590300_0.conda#dcde58ff9a1f30b0037a2315d1846d1f +https://conda.anaconda.org/conda-forge/linux-64/deno-1.37.2-h335b0a9_1.conda#50fe6d0064adfd83846a6f9c87da03e3 +https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.10-h36c2ea0_0.tar.bz2#ac7bc6a654f8f41b352b38f4051135f8 +https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3 +https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 +https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d +https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_11.conda#c485da4fdb454539f852a90ae06e9bb7 +https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e +https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda#ea25936bb4080d843790b586850f82b8 +https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_11.conda#eaa8ea74083fb4a78ae19e431e556003 +https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b +https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.4.0-hd590300_0.conda#b26e8aa824079e1be0294e7152ca4559 +https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-h4ab18f5_1.conda#57d7dc60e9325e3de37ff8dffd18e814 +https://conda.anaconda.org/conda-forge/linux-64/make-4.3-hd18ef5c_1.tar.bz2#4049ebfd3190b580dffe76daed26155a +https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h59595ed_0.conda#fcea371545eda051b6deafb24889fc69 +https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.1-h4ab18f5_0.conda#a41fa0e391cc9e0d6b78ac69ca047a6c +https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2#22dad4df6e8630e8dff2428f6f6a7036 +https://conda.anaconda.org/conda-forge/linux-64/sed-4.8-he412f7d_0.tar.bz2#7362f0042e95681f5d371c46c83ebd08 +https://conda.anaconda.org/conda-forge/linux-64/xorg-kbproto-1.0.7-h7f98852_1002.tar.bz2#4b230e8381279d76131116660f5a241a +https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.1-hd590300_0.conda#b462a33c0be1421532f28bfe8f4a7514 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.11-hd590300_0.conda#2c80dc38fface310c9bd81b17037fee5 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.3-h7f98852_0.tar.bz2#be93aabceefa2fac576e971aef407908 +https://conda.anaconda.org/conda-forge/linux-64/xorg-renderproto-0.11.1-h7f98852_1002.tar.bz2#06feff3d2634e3097ce2fe681474b534 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xextproto-7.3.0-h0b41bf4_1003.conda#bce9f945da8ad2ae9b1d7165a64d0f87 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007.tar.bz2#b4a4381d54784606820704f7b5f05a15 +https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 +https://conda.anaconda.org/conda-forge/linux-64/deno-dom-0.1.35-hd9586b0_1.conda#263ee0870b18b013d9ec8539113ac69f +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 +https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.13-h59595ed_1003.conda#f87c7b7c2cb45f323ffbce941c78ab7c +https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff +https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2#76bbff344f0134279f225174e9064c8f +https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_11.conda#4c3e460d6acf8e43e4ce8bf405187eb7 +https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a +https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.43-h2797004_0.conda#009981dd9cfcaa4dbfa25ffaed86bcae +https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-13.2.0-h6ddb7a1_11.conda#3227eb98475de9cb375391aa28b931d5 +https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe +https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.16-hd590300_0.conda#151cba22b85a989c2d6ef9633ffee1e4 +https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.44-h0f59acf_0.conda#3914f7ac1761dce57102c72ca7c35d01 +https://conda.anaconda.org/conda-forge/linux-64/pixman-0.43.2-h59595ed_0.conda#71004cbf7924e19c02746ccde9fd7123 +https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 +https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc +https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.4-h7391055_0.conda#93ee23f12bc2e684548181256edd2cf6 +https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda#9653f1bf3766164d0e65fa723cabbc54 +https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda#4d056880988120e29d75bfff282e0f45 +https://conda.anaconda.org/conda-forge/linux-64/bwidget-1.9.14-ha770c72_1.tar.bz2#5746d6202ba2abad4a4707f2a2462795 +https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda#9ae35c3d96db2c94ce0cef86efdfa2cb +https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-13.2.0-h9eb54c0_11.conda#6ba78509a489a8a7882328468f187cc9 +https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844 +https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-h8a4344b_1.conda#9c406bb3d4dac2b358873e6462496d09 +https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.27-pthreads_h413a1c8_0.conda#a356024784da6dfd4683dc5ecf45b155 +https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda#66f03896ffbe1a110ffda05c7a856504 +https://conda.anaconda.org/conda-forge/linux-64/quarto-1.4.550-ha770c72_1.conda#b7b89be76bcdab239f7956e5fc2727ab +https://conda.anaconda.org/conda-forge/linux-64/tktable-2.10-h0c5db8f_5.conda#9464044754ea25557a9c93f0327d90a6 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.9-hb711507_1.conda#4a6d410296d7e39f00bacdee7df046e9 +https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.14.2-h14ed4e7_0.conda#0f69b688f52ff6da70bccb7ff7001d1d +https://conda.anaconda.org/conda-forge/linux-64/gfortran_impl_linux-64-13.2.0-h9efe08d_11.conda#d08f638bb8b62d71f2222ecb7003a995 +https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.2.0-h2a599c4_11.conda#c2f0227c9bea564b8edc2f1de939c76d +https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-22_linux64_openblas.conda#1a2a0cd3153464fee6646f3dd6dad9b8 +https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda#f21c27f076a07907e70c49bb57bd0f20 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.4-h0b41bf4_2.conda#82b6df12252e6f32402b96dacc656fec +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.11-hd590300_0.conda#ed67c36f215b310412b2af935bf3e530 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxt-1.3.0-hd590300_1.conda#ae92aab42726eb29d16488924f7312cb +https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-hbb29018_1.conda#e31a51ddd52326d10a9cc50b0d68daab +https://conda.anaconda.org/conda-forge/linux-64/curl-8.8.0-he654da7_0.conda#042341d8b9ba4ee7f2722b81fae9f0ad +https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-22_linux64_openblas.conda#b083767b6c877e24ee597d93b87ab838 +https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-8.5.0-hfac3d4d_0.conda#f5126317dd0ce0ba26945e411ecc6960 +https://conda.anaconda.org/conda-forge/linux-64/pango-1.54.0-h84a9a3c_0.conda#7c51e110b2f059c0843269d3324e4b22 +https://conda.anaconda.org/conda-forge/linux-64/r-base-4.3.3-h8ee917f_2.conda#fdd20aea0c8243bfa7fb85d144f4febe +https://conda.anaconda.org/conda-forge/linux-64/r-base64enc-0.1_3-r43h57805ef_1006.conda#3cb46d4c0d2096491f9934da0e1555ee +https://conda.anaconda.org/conda-forge/linux-64/r-cli-3.6.2-r43ha503ecb_0.conda#7a325f68b1354c1a5261688b5e54d008 +https://conda.anaconda.org/conda-forge/linux-64/r-curl-5.1.0-r43hf9611b0_0.conda#d2a3cc302656e5ff30fc635fd9ef3ae6 +https://conda.anaconda.org/conda-forge/linux-64/r-data.table-1.15.4-r43ha8f4200_0.conda#7f80fa5300b292c19bab54674884e233 +https://conda.anaconda.org/conda-forge/linux-64/r-digest-0.6.35-r43ha503ecb_0.conda#d28a7db9b060ceaf683f0b036780b962 +https://conda.anaconda.org/conda-forge/noarch/r-evaluate-0.24.0-r43hc72bb7e_0.conda#1c3aa7ca297fae40ea8d6a8fe78317f0 +https://conda.anaconda.org/conda-forge/linux-64/r-fastmap-1.2.0-r43ha18555a_0.conda#f60a0e293418fc91b73bd67aa62d4a79 +https://conda.anaconda.org/conda-forge/linux-64/r-fs-1.6.4-r43ha18555a_0.conda#c0cc6b111eb64c8d21f4feeb53c8d06d +https://conda.anaconda.org/conda-forge/linux-64/r-glue-1.7.0-r43h57805ef_0.conda#20e2cb7c0d27bccf8fe21ec5c3897751 +https://conda.anaconda.org/conda-forge/linux-64/r-jsonlite-1.8.8-r43h57805ef_0.conda#fb01953d78a87de6211b1ebccafed273 +https://conda.anaconda.org/conda-forge/linux-64/r-mime-0.12-r43h57805ef_2.conda#348f6adefce6912321b2a2ab0528ae89 +https://conda.anaconda.org/conda-forge/noarch/r-packrat-0.9.2-r43hc72bb7e_0.conda#acc0bee43ed5a63ef521aa6995541e97 +https://conda.anaconda.org/conda-forge/linux-64/r-ps-1.7.6-r43h57805ef_0.conda#48f9e73215aa6de4545ec3ec36e5e534 +https://conda.anaconda.org/conda-forge/noarch/r-r6-2.5.1-r43hc72bb7e_2.conda#79f167972554dc6b65aa099cd85c22a1 +https://conda.anaconda.org/conda-forge/linux-64/r-rappdirs-0.3.3-r43h57805ef_2.conda#788ac4f3dcfa79520bfc9eeadf50c2eb +https://conda.anaconda.org/conda-forge/linux-64/r-rcpp-1.0.12-r43h7df8631_0.conda#a8aac8be0868617b28f27484ea548d6c +https://conda.anaconda.org/conda-forge/noarch/r-renv-1.0.7-r43hc72bb7e_0.conda#efa116dc4d7118a48c97f6f8f4861427 +https://conda.anaconda.org/conda-forge/linux-64/r-rlang-1.1.4-r43ha18555a_0.conda#74c4cb6644843dccabc350cba4b56ec6 +https://conda.anaconda.org/conda-forge/noarch/r-rstudioapi-0.16.0-r43hc72bb7e_0.conda#02c7b3c36e390b0c538300adab8ca3eb +https://conda.anaconda.org/conda-forge/linux-64/r-sys-3.4.2-r43h57805ef_1.conda#ae6e4dd935d9c91064cbca07d2769d75 +https://conda.anaconda.org/conda-forge/linux-64/r-xfun-0.45-r43ha18555a_0.conda#cced29e73709a7c9b2495a4f5d695d66 +https://conda.anaconda.org/conda-forge/linux-64/r-yaml-2.3.8-r43h57805ef_0.conda#41db1ee9d0073339e681379b92e7dfb6 +https://conda.anaconda.org/conda-forge/linux-64/r-askpass-1.2.0-r43h57805ef_0.conda#ee095f1d72a1d80864816e44623ba392 +https://conda.anaconda.org/conda-forge/linux-64/r-cachem-1.1.0-r43hb1dbf0f_0.conda#d48720030e2b1d780389bafa5a9c7536 +https://conda.anaconda.org/conda-forge/linux-64/r-ellipsis-0.3.2-r43h57805ef_2.conda#10c5892991072cfa3a61489d2ac6ad66 +https://conda.anaconda.org/conda-forge/noarch/r-highr-0.11-r43hc72bb7e_0.conda#ecd3b95a01caa7bdcf63714427b5b88c +https://conda.anaconda.org/conda-forge/linux-64/r-later-1.3.2-r43ha503ecb_0.conda#6e120827a341f21444881e84408e98a7 +https://conda.anaconda.org/conda-forge/noarch/r-lifecycle-1.0.4-r43hc72bb7e_0.conda#291d2fb68ea1b181644b40d6743ae000 +https://conda.anaconda.org/conda-forge/linux-64/r-pki-0.1_14-r43hb1dbf0f_0.conda#58c4dc882730c0d96ca09e58be0150d8 +https://conda.anaconda.org/conda-forge/linux-64/r-processx-3.8.4-r43h57805ef_0.conda#660d4e9ff8beef35dbda645484d17a25 +https://conda.anaconda.org/conda-forge/noarch/r-tinytex-0.51-r43hc72bb7e_0.conda#16653f65f1ab934e1a9bdac874f9b63b +https://conda.anaconda.org/conda-forge/linux-64/r-htmltools-0.5.8.1-r43ha503ecb_0.conda#220b9c45f5867a42d49bde8d340e9e53 +https://conda.anaconda.org/conda-forge/noarch/r-knitr-1.47-r43hc72bb7e_0.conda#0310660d998a5933bb4545a312ed7385 +https://conda.anaconda.org/conda-forge/noarch/r-memoise-2.0.1-r43hc72bb7e_2.conda#6520452e207d8f9bab9f21492f88c48b +https://conda.anaconda.org/conda-forge/linux-64/r-openssl-2.2.0-r43hd7d0243_0.conda#60f961514ecc3ee1fd7b1afd6ea853ab +https://conda.anaconda.org/conda-forge/noarch/r-fontawesome-0.5.2-r43hc72bb7e_0.conda#d07f215759462959de39d7232386f1b9 +https://conda.anaconda.org/conda-forge/noarch/r-jquerylib-0.1.4-r43hc72bb7e_2.conda#49a3fad710cbccec9139b36587842f88 +https://conda.anaconda.org/conda-forge/noarch/r-rsconnect-1.3.1-r43hc72bb7e_0.conda#474409574da3aacf988008567cbf11b7 +https://conda.anaconda.org/conda-forge/linux-64/r-sass-0.4.9-r43ha503ecb_0.conda#58e32ad6d979828aa0fc3da59e1b4d78 +https://conda.anaconda.org/conda-forge/noarch/r-bslib-0.7.0-r43hc72bb7e_0.conda#6e2bfdc782284259390d09bb083142b2 +https://conda.anaconda.org/conda-forge/noarch/r-rmarkdown-2.27-r43hc72bb7e_1.conda#4b681e35650d7d10737bc0c6ed80ae9a +https://conda.anaconda.org/conda-forge/noarch/r-quarto-1.4-r43hc72bb7e_0.conda#a86d89513116deba7cc3c6e8e72a0f61 diff --git a/utils/quarto/test/env/extra.yaml b/utils/quarto/test/env/extra.yaml new file mode 100644 index 00000000000..9def1b92e4e --- /dev/null +++ b/utils/quarto/test/env/extra.yaml @@ -0,0 +1,6 @@ +channels: + - conda-forge +dependencies: + - r-quarto + - r-data.table + diff --git a/utils/quarto/test/extra_datatable.qmd b/utils/quarto/test/extra_datatable.qmd new file mode 100644 index 00000000000..611f895a649 --- /dev/null +++ b/utils/quarto/test/extra_datatable.qmd @@ -0,0 +1,12 @@ +--- +title: "Quarto example with additional package dependency" +author: "Vito Zanotelli, University Children's Hospital Zurich" +format: html +--- + +This quarto mardown demonstrates how an extra +dependency can be installed either via conda or renv. + +```{r, Try to load data table} +library(data.table) +``` diff --git a/utils/quarto/test/full.qmd b/utils/quarto/test/full.qmd new file mode 100644 index 00000000000..c7a55a55495 --- /dev/null +++ b/utils/quarto/test/full.qmd @@ -0,0 +1,15 @@ +--- +title: "Full Quarto example: `r params$project`" +author: "Vito Zanotelli, University Children's Hospital Zurich" +format: html +params: + input_txt: '../results/test.txt' + output_txt: '../results/test_copy.txt' + project: 'Test' +--- + + +```{r} +#| label: copy example file +file.copy(params$input_txt, params$output_txt) +``` diff --git a/utils/quarto/test/simple.qmd b/utils/quarto/test/simple.qmd new file mode 100644 index 00000000000..68153bd54d2 --- /dev/null +++ b/utils/quarto/test/simple.qmd @@ -0,0 +1,7 @@ +--- +title: "Quarto example" +author: "Vito" +format: html +--- + +Hello Quarto! \ No newline at end of file diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py new file mode 100644 index 00000000000..275ef63c8fa --- /dev/null +++ b/utils/quarto/wrapper.py @@ -0,0 +1,97 @@ +__author__ = "Vito Zanotelli" +__copyright__ = "Copyright 2024, Vito Zanotelli" +__email__ = "vito.zanotelli@kispi.uzh.ch" +__license__ = "MIT" + +import tempfile +from pathlib import Path +import warnings +from snakemake.shell import shell + + +def parse_renv(renv_path: Path) -> str: + """Parse the renv path + + Args: + renv_path (Path): A path to an renv folder + or a file in the renv folder + + Returns: + str: the resolved path pointing to the + renv folder + """ + if renv_path.is_file(): + renv_path = renv_path.parent + return str(renv_path.resolve()) + + +def add_parameter(name: str, value, param_list: list[str]) -> None: + """Add a parameter to the parameter list in place + + Args: + name (str): The name of the parameter + value (str): The value of the parameter + param_list (list[str]): The list of parameters + + Returns: + None + """ + if isinstance(value, list): + value = ",".join(value) + param_list.append("-P {}:{}".format(name, value)) + + +renv = parse_renv(Path(snakemake.input.get("renv", "."))) +script = Path(snakemake.input.get("script")) +report = snakemake.output.get("report", None) + + +# Build params +params = [] +for name, value in snakemake.input.items(): + if name not in {"renv", "script"}: + add_parameter(name, value, params) + +for name, value in snakemake.params.items(): + add_parameter(name, value, params) + +for name, value in snakemake.output.items(): + if name not in {"report"}: + add_parameter(name, value, params) +logfile = snakemake.log +if logfile: + snakemake.log = str(Path(str(logfile)).resolve()) + log = snakemake.log_fmt_shell(stdout=True, stderr=True) + +args = " ".join(params) + +with tempfile.TemporaryDirectory() as temp_output: + if report is None: + out_report = Path(temp_output) / script.name + out_report_rendered = out_report + report_path = f"{out_report}.tmp" + else: + report_path = Path(report).resolve() + out_report = ( + report_path.parent / f"{report_path.stem}_temp_{report_path.suffix[1:]}.qmd" + ) + out_report_rendered = out_report.with_suffix(report_path.suffix) + if report_path.suffix == ".pdf": + warnings.warn( + "PDF output is likely not supported yet, as tinytex not installable" + " via conda: https://github.com/conda-forge/quarto-feedstock/issues/26" + ) + args += f" --to={report_path.suffix[1:]}" + shell(""" + # copy the input script to prevent name clashes + cp {script} {out_report} + WD=$(pwd) + # Change to renv directory to enable the renv + cd "{renv}" + quarto render {out_report} \ + {args} \ + --execute-dir="$WD" \ + {log} + # move the output to the final destination + mv {out_report_rendered} {report_path} + """) From 318edf0cf1938c30ab147c5b569a89a9743ac006 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Thu, 20 Jun 2024 16:25:54 +0200 Subject: [PATCH 02/18] docs: small corrections --- utils/quarto/test/extra_datatable.qmd | 7 +++++-- utils/quarto/test/simple.qmd | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/quarto/test/extra_datatable.qmd b/utils/quarto/test/extra_datatable.qmd index 611f895a649..0c724a0d4f7 100644 --- a/utils/quarto/test/extra_datatable.qmd +++ b/utils/quarto/test/extra_datatable.qmd @@ -4,8 +4,11 @@ author: "Vito Zanotelli, University Children's Hospital Zurich" format: html --- -This quarto mardown demonstrates how an extra -dependency can be installed either via conda or renv. +This quarto markdown is used to demonstrate how an extra +dependency - 'data.table' can be installed either via conda or renv. + +As 'data.table' is not available in the base environment, building +this report fails if it has not been additionally installed. ```{r, Try to load data table} library(data.table) diff --git a/utils/quarto/test/simple.qmd b/utils/quarto/test/simple.qmd index 68153bd54d2..eab3afb7372 100644 --- a/utils/quarto/test/simple.qmd +++ b/utils/quarto/test/simple.qmd @@ -1,6 +1,6 @@ --- title: "Quarto example" -author: "Vito" +author: "Vito Zanotelli, University Children's Hospital Zurich" format: html --- From a95864f6998f84faf681a873247b65c311101cba Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Thu, 20 Jun 2024 16:29:50 +0200 Subject: [PATCH 03/18] doc: improve documentation --- utils/quarto/wrapper.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py index 275ef63c8fa..8a06d23e95c 100644 --- a/utils/quarto/wrapper.py +++ b/utils/quarto/wrapper.py @@ -46,7 +46,7 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: report = snakemake.output.get("report", None) -# Build params +# Build params to be passed to Quarto params (-P flag) params = [] for name, value in snakemake.input.items(): if name not in {"renv", "script"}: @@ -58,6 +58,10 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: for name, value in snakemake.output.items(): if name not in {"report"}: add_parameter(name, value, params) + +# Resolve the logfile path and set the log_fmt_shell +# This is required as we may change the working directory +# to the renv folder for execution of quarto. logfile = snakemake.log if logfile: snakemake.log = str(Path(str(logfile)).resolve()) @@ -67,14 +71,23 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: with tempfile.TemporaryDirectory() as temp_output: if report is None: + # In case no report output is specified, + # the output is created in a temporary folder out_report = Path(temp_output) / script.name out_report_rendered = out_report report_path = f"{out_report}.tmp" else: + # In case an output is specified, + # the output is created in the target folder. report_path = Path(report).resolve() + # The report to-be-rendered is namespaced + # to prevent clashes. out_report = ( - report_path.parent / f"{report_path.stem}_temp_{report_path.suffix[1:]}.qmd" + report_path.parent / f"{report_path.stem}_{report_path.suffix[1:]}.qmd" ) + # The rendered report is named as the final report with the correct suffix + # Note that in addition ot the target report file, also a folder `*_files/` + # is created, which contains the images and other files linked in the html report. out_report_rendered = out_report.with_suffix(report_path.suffix) if report_path.suffix == ".pdf": warnings.warn( From 26519a2bf02033c484563f37f8567ef3a4055c25 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Thu, 20 Jun 2024 16:29:50 +0200 Subject: [PATCH 04/18] doc: improve documentation --- utils/quarto/meta.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index ec654468a05..7f03a83c498 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -27,7 +27,8 @@ input: output: - report: > Optional: - Path to the rendered report. The file extension will be used to determine the output format (eg `report.html`, `report.pdf`) + Path to the rendered report. The file extension will be used to determine the output format (eg `report.html`, `report.docx`). + PDF rendering is currently not supported due to the lack of support of tinytex in conda-forge. If not provided, the report will be rendered in a temporary directory and no output will be returned. - `: > Additional output files. These the paths will be passed as `params:` to the quarto script @@ -36,7 +37,15 @@ params: - `: > Additional parameters to be passed to the quarto script. These the paths will be passed as `params:` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr - If wildcards should be passed to the `quarto` script, use a function to pass it in params: - `params: project: lambda wc: wc.project` + If wildcards/threads should be passed to the `quarto` script, use a function to pass it in params: + ``` + params: + project: lambda wc: wc.project` + threads: lambda wc, threads: threads + mem: lambda wc, resources: resources.mem + + ``` notes: | - This wrapper runs \ No newline at end of file + This wrapper runs quarto to render markdown .qmd notebooks. It supports r-package management via conda and renv, as illustrated + in the examples. + PDF rendering is currently not working. \ No newline at end of file From b17f4282c792dd971c1251143cffdbb4bb467c2a Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 09:21:06 +0200 Subject: [PATCH 05/18] Remove renv dependencies from conda env This simplifies the dependencies in the main conda environment. This required then to rewrite the tests to use a separate conda environment with renv installed in order to build and restore the renv. --- utils/quarto/environment.linux-64.pin.txt | 34 -- utils/quarto/environment.yaml | 32 +- utils/quarto/test/Snakefile | 20 +- utils/quarto/test/env/renv.linux-64.pin.txt | 92 +++++ utils/quarto/test/env/renv.yaml | 5 + utils/quarto/test/env/renv_dt.lock | 418 ++++++++++++++++++++ utils/quarto/wrapper.py | 8 +- 7 files changed, 528 insertions(+), 81 deletions(-) create mode 100644 utils/quarto/test/env/renv.linux-64.pin.txt create mode 100644 utils/quarto/test/env/renv.yaml create mode 100644 utils/quarto/test/env/renv_dt.lock diff --git a/utils/quarto/environment.linux-64.pin.txt b/utils/quarto/environment.linux-64.pin.txt index 2e7a488176d..243c64641ff 100644 --- a/utils/quarto/environment.linux-64.pin.txt +++ b/utils/quarto/environment.linux-64.pin.txt @@ -16,41 +16,32 @@ https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-hf3520f5_7 https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-13.2.0-hdb50d1a_111.conda#43178c27fac2dcd495bd9e58e18272d9 https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-13.2.0-hdb50d1a_111.conda#4ffa92ea4ba6555dee156ce3d0ae7a9b https://conda.anaconda.org/conda-forge/linux-64/pandoc-3.1.11.1-ha770c72_0.conda#0e2f14aff42adf4675bcd5335d644a5f -https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda#161081fc7cec0bfda0d86d7cb595f8d8 https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2#f766549260d6815b0c52253f1fb1bb29 https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_11.conda#8c462ced2af33648195dc9459f331f31 https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda#595db67e32b276298ff3d94d07d47fbf https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-ha1999f0_7.conda#3f840c7ed70a96b5ebde8044b2f36f32 https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2#fee5683a3f04bd15cbd8318b096a27ab -https://conda.anaconda.org/conda-forge/linux-64/binutils-2.40-h4852527_7.conda#df53aa8418f8c289ae9b9665986034f8 -https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.40-hb3c18ed_7.conda#ca84cd2dcc3d3e200f8e9aff105cbcb3 https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_11.conda#0b3b218a596bb4c3854cc9ee799f94e5 https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4 https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.28.1-hd590300_0.conda#dcde58ff9a1f30b0037a2315d1846d1f https://conda.anaconda.org/conda-forge/linux-64/deno-1.37.2-h335b0a9_1.conda#50fe6d0064adfd83846a6f9c87da03e3 https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.10-h36c2ea0_0.tar.bz2#ac7bc6a654f8f41b352b38f4051135f8 -https://conda.anaconda.org/conda-forge/linux-64/gettext-tools-0.22.5-h59595ed_2.conda#985f2f453fb72408d6b6f1be0f324033 https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3 https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 -https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-0.22.5-h59595ed_2.conda#172bcc51059416e7ce99e7b528cede83 https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_11.conda#c485da4fdb454539f852a90ae06e9bb7 https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda#ea25936bb4080d843790b586850f82b8 -https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda#30fd6e37fe21f86f4bd26d6ee73eeec7 https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_11.conda#eaa8ea74083fb4a78ae19e431e556003 https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.4.0-hd590300_0.conda#b26e8aa824079e1be0294e7152ca4559 -https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda#5aa797f8787fe7a17d1b0821485b5adc https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-h4ab18f5_1.conda#57d7dc60e9325e3de37ff8dffd18e814 -https://conda.anaconda.org/conda-forge/linux-64/m4-1.4.18-h516909a_1001.tar.bz2#4abb931c0d08a41583fc637c663e45e2 https://conda.anaconda.org/conda-forge/linux-64/make-4.3-hd18ef5c_1.tar.bz2#4049ebfd3190b580dffe76daed26155a https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h59595ed_0.conda#fcea371545eda051b6deafb24889fc69 https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.1-h4ab18f5_0.conda#a41fa0e391cc9e0d6b78ac69ca047a6c -https://conda.anaconda.org/conda-forge/linux-64/pkg-config-0.29.2-h36c2ea0_1008.tar.bz2#fbef41ff6a4c8140c30057466a1cdd47 https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2#22dad4df6e8630e8dff2428f6f6a7036 https://conda.anaconda.org/conda-forge/linux-64/sed-4.8-he412f7d_0.tar.bz2#7362f0042e95681f5d371c46c83ebd08 https://conda.anaconda.org/conda-forge/linux-64/xorg-kbproto-1.0.7-h7f98852_1002.tar.bz2#4b230e8381279d76131116660f5a241a @@ -63,69 +54,44 @@ https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007 https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 https://conda.anaconda.org/conda-forge/linux-64/deno-dom-0.1.35-hd9586b0_1.conda#263ee0870b18b013d9ec8539113ac69f https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 -https://conda.anaconda.org/conda-forge/linux-64/gmp-6.3.0-h59595ed_1.conda#e358c7c5f6824c272b5034b3816438a7 https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.13-h59595ed_1003.conda#f87c7b7c2cb45f323ffbce941c78ab7c https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2#76bbff344f0134279f225174e9064c8f -https://conda.anaconda.org/conda-forge/linux-64/libasprintf-0.22.5-h661eb56_2.conda#dd197c968bf9760bba0031888d431ede https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1 -https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-devel-0.22.5-h59595ed_2.conda#b63d9b6da3653179a278077f0de20014 https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_11.conda#4c3e460d6acf8e43e4ce8bf405187eb7 -https://conda.anaconda.org/conda-forge/linux-64/libint-2.9.0-h9bbc0ff_0.conda#eb70ffeb6cdb59c11389eba5a02ad9d4 https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.43-h2797004_0.conda#009981dd9cfcaa4dbfa25ffaed86bcae https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-13.2.0-h6ddb7a1_11.conda#3227eb98475de9cb375391aa28b931d5 -https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.46.0-hde9e2c9_0.conda#18aa975d2094c34aef978060ae7da7d8 https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.16-hd590300_0.conda#151cba22b85a989c2d6ef9633ffee1e4 -https://conda.anaconda.org/conda-forge/linux-64/llvm-openmp-8.0.1-hc9558a2_0.tar.bz2#67590caab043d6d7ffc371f9cced7848 https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.44-h0f59acf_0.conda#3914f7ac1761dce57102c72ca7c35d01 -https://conda.anaconda.org/conda-forge/linux-64/perl-5.32.1-7_hd590300_perl5.conda#f2cfec9406850991f4e3d960cc9e3321 https://conda.anaconda.org/conda-forge/linux-64/pixman-0.43.2-h59595ed_0.conda#71004cbf7924e19c02746ccde9fd7123 https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.4-h7391055_0.conda#93ee23f12bc2e684548181256edd2cf6 https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda#9653f1bf3766164d0e65fa723cabbc54 https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda#4d056880988120e29d75bfff282e0f45 -https://conda.anaconda.org/conda-forge/linux-64/autoconf-2.71-pl5321h2b4cb7a_1.conda#50cabb1aee157a18082c7c92cc4b3143 https://conda.anaconda.org/conda-forge/linux-64/bwidget-1.9.14-ha770c72_1.tar.bz2#5746d6202ba2abad4a4707f2a2462795 https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda#9ae35c3d96db2c94ce0cef86efdfa2cb https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-13.2.0-h9eb54c0_11.conda#6ba78509a489a8a7882328468f187cc9 -https://conda.anaconda.org/conda-forge/linux-64/glpk-5.0-h445213a_0.tar.bz2#efc4b0c33bdf47312ad5a8a0587fa653 https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844 -https://conda.anaconda.org/conda-forge/linux-64/libasprintf-devel-0.22.5-h661eb56_2.conda#02e41ab5834dcdcc8590cf29d9526f50 https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-h8a4344b_1.conda#9c406bb3d4dac2b358873e6462496d09 https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.27-pthreads_h413a1c8_0.conda#a356024784da6dfd4683dc5ecf45b155 https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda#66f03896ffbe1a110ffda05c7a856504 -https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.11.6-h232c23b_0.conda#427a3e59d66cb5d145020bd9c6493334 -https://conda.anaconda.org/conda-forge/linux-64/openmp-8.0.1-0.tar.bz2#b35241079152e5cc891c99368395b2c6 -https://conda.anaconda.org/conda-forge/linux-64/python-3.12.4-h194c7f8_0_cpython.conda#d73490214f536cccb5819e9873048c92 https://conda.anaconda.org/conda-forge/linux-64/quarto-1.4.550-ha770c72_1.conda#b7b89be76bcdab239f7956e5fc2727ab https://conda.anaconda.org/conda-forge/linux-64/tktable-2.10-h0c5db8f_5.conda#9464044754ea25557a9c93f0327d90a6 https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.9-hb711507_1.conda#4a6d410296d7e39f00bacdee7df046e9 https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.14.2-h14ed4e7_0.conda#0f69b688f52ff6da70bccb7ff7001d1d -https://conda.anaconda.org/conda-forge/linux-64/gcc-13.2.0-hc7bed06_11.conda#af15e113c65619887dcabd64d40a7897 -https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-13.2.0-h3668938_7.conda#fb11f301f0da4767740b9a0ea6aeb7d6 -https://conda.anaconda.org/conda-forge/linux-64/gettext-0.22.5-h59595ed_2.conda#219ba82e95d7614cf7140d2a4afc0926 https://conda.anaconda.org/conda-forge/linux-64/gfortran_impl_linux-64-13.2.0-h9efe08d_11.conda#d08f638bb8b62d71f2222ecb7003a995 -https://conda.anaconda.org/conda-forge/linux-64/glib-tools-2.80.2-h73ef956_1.conda#1daf2cc7054ff71b9a05485f2562cbb4 https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.2.0-h2a599c4_11.conda#c2f0227c9bea564b8edc2f1de939c76d https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-22_linux64_openblas.conda#1a2a0cd3153464fee6646f3dd6dad9b8 https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda#f21c27f076a07907e70c49bb57bd0f20 -https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda#cbe1bb1f21567018ce595d9c2be0f0db -https://conda.anaconda.org/conda-forge/noarch/setuptools-70.1.0-pyhd8ed1ab_0.conda#258e66f95f814d51ada2a1fe9274039b -https://conda.anaconda.org/conda-forge/noarch/wheel-0.43.0-pyhd8ed1ab_1.conda#0b5293a157c2b5cd513dd1b03d8d3aae https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.4-h0b41bf4_2.conda#82b6df12252e6f32402b96dacc656fec https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.11-hd590300_0.conda#ed67c36f215b310412b2af935bf3e530 https://conda.anaconda.org/conda-forge/linux-64/xorg-libxt-1.3.0-hd590300_1.conda#ae92aab42726eb29d16488924f7312cb https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-hbb29018_1.conda#e31a51ddd52326d10a9cc50b0d68daab https://conda.anaconda.org/conda-forge/linux-64/curl-8.8.0-he654da7_0.conda#042341d8b9ba4ee7f2722b81fae9f0ad -https://conda.anaconda.org/conda-forge/linux-64/gfortran-13.2.0-hc7bed06_11.conda#214466faa9389783bb8a0a468c868e80 -https://conda.anaconda.org/conda-forge/linux-64/glib-2.80.2-h8a4344b_1.conda#dad336abc079b9a38dc10087231619cd -https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-13.2.0-h4ebd915_7.conda#1ed21c271aff2e49de5d0e352b62837e https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-22_linux64_openblas.conda#b083767b6c877e24ee597d93b87ab838 -https://conda.anaconda.org/conda-forge/noarch/pip-24.0-pyhd8ed1ab_0.conda#f586ac1e56c8638b64f9c8122a7b8a67 -https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.0.0-hf484d3e_0.tar.bz2#5f1c23fd134564eeb5ee730640168c5a https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-8.5.0-hfac3d4d_0.conda#f5126317dd0ce0ba26945e411ecc6960 https://conda.anaconda.org/conda-forge/linux-64/pango-1.54.0-h84a9a3c_0.conda#7c51e110b2f059c0843269d3324e4b22 https://conda.anaconda.org/conda-forge/linux-64/r-base-4.3.3-h8ee917f_2.conda#fdd20aea0c8243bfa7fb85d144f4febe diff --git a/utils/quarto/environment.yaml b/utils/quarto/environment.yaml index 3fd64e3e467..76620d0b3ee 100644 --- a/utils/quarto/environment.yaml +++ b/utils/quarto/environment.yaml @@ -2,34 +2,4 @@ channels: - conda-forge - nodefaults dependencies: - - r-base - - r-renv - - r-quarto - # This lists fairly excessive - # dependencies that may be used to build - # R packages from source within this environment. - - binutils - - glib - - gettext - - gxx_linux-64 - - gcc_linux-64 - - make - - pkg-config - - libgomp - - zlib - - libblas - - liblapack - - autoconf - - glpk - - gmp - # r xml2: https://github.com/r-lib/xml2/issues/418 - - libxml2==2.11.6 - - gfortran - - openmp - - gettext-tools - - libiconv - - pcre2 - - libint - - packaging - - setuptools - - cxx-compiler + - r-quarto \ No newline at end of file diff --git a/utils/quarto/test/Snakefile b/utils/quarto/test/Snakefile index b6e7c215bac..d265e31f73f 100644 --- a/utils/quarto/test/Snakefile +++ b/utils/quarto/test/Snakefile @@ -87,32 +87,26 @@ wildcard_constraints: # The `renv_lock` on renv rules is an artificial resource to prevent multiple # renv operations at the same time, which may cause issues.. # In such cases restrict it via the -# resources CLI flag: --resources renv_lock=1 +# resources CLI flag: --resources renv_lock=1 --set-resource-scopes renv_lock=global rule renv_example_init: conda: - "../environment.yaml" + "env/renv.yaml" + input: + lockfile="env/renv_dt.lock", output: rprofile="{renv_dir}/.Rprofile", lockfile="{renv_dir}/renv.lock", - params: - dependencies="'quarto','data.table'", resources: renv_lock=1, log: "logs/renv/{renv_dir}_init.log", shell: """ - DIRNAME="{wildcards.renv_dir}" - mkdir -p $DIRNAME - cd $DIRNAME - Rscript -e "renv::init();" - # somehow the lockfile needs to be removed - # otherwise renv::install wont work with `Error: package 'data.table' is not available' - rm $(basename {output.lockfile}) - Rscript -e "renv::install(c('data.table', 'quarto'));\ - renv::snapshot(type='all')" + Rscript -e "renv::init(project='{wildcards.renv_dir}', bare=T); \ + renv::restore(project='{wildcards.renv_dir}', lockfile='$(realpath {input.lockfile})');\ + renv::snapshot(type='all')" """ diff --git a/utils/quarto/test/env/renv.linux-64.pin.txt b/utils/quarto/test/env/renv.linux-64.pin.txt new file mode 100644 index 00000000000..a1a3b84cb6e --- /dev/null +++ b/utils/quarto/test/env/renv.linux-64.pin.txt @@ -0,0 +1,92 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +@EXPLICIT +https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81 +https://conda.anaconda.org/conda-forge/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2#19f9db5f4f1b7f5ef5f6d67207f25f38 +https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.6.2-hbcca054_0.conda#847c3c2905cc467cea52c24f9cfa8080 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2#0c96522c6bdaed4b1566d11387caaf45 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2#34893075a5c9e55cdafac56607368fc6 +https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2#4d59c254e01d9cde7957100457e2d5fb +https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_2.conda#cbbe59391138ea5ad3658c76912e147f +https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda#d731b543793afc0433c4fd593e693fce +https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-hf3520f5_7.conda#b80f2f396ca2c28b8c14c437a4ed1e74 +https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-13.2.0-hdb50d1a_111.conda#43178c27fac2dcd495bd9e58e18272d9 +https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-13.2.0-hdb50d1a_111.conda#4ffa92ea4ba6555dee156ce3d0ae7a9b +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2#f766549260d6815b0c52253f1fb1bb29 +https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_11.conda#8c462ced2af33648195dc9459f331f31 +https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda#595db67e32b276298ff3d94d07d47fbf +https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d +https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-ha1999f0_7.conda#3f840c7ed70a96b5ebde8044b2f36f32 +https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2#fee5683a3f04bd15cbd8318b096a27ab +https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_11.conda#0b3b218a596bb4c3854cc9ee799f94e5 +https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4 +https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.28.1-hd590300_0.conda#dcde58ff9a1f30b0037a2315d1846d1f +https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.10-h36c2ea0_0.tar.bz2#ac7bc6a654f8f41b352b38f4051135f8 +https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3 +https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 +https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 +https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d +https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_11.conda#c485da4fdb454539f852a90ae06e9bb7 +https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e +https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda#ea25936bb4080d843790b586850f82b8 +https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_11.conda#eaa8ea74083fb4a78ae19e431e556003 +https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b +https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.4.0-hd590300_0.conda#b26e8aa824079e1be0294e7152ca4559 +https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-h4ab18f5_1.conda#57d7dc60e9325e3de37ff8dffd18e814 +https://conda.anaconda.org/conda-forge/linux-64/make-4.3-hd18ef5c_1.tar.bz2#4049ebfd3190b580dffe76daed26155a +https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h59595ed_0.conda#fcea371545eda051b6deafb24889fc69 +https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.1-h4ab18f5_0.conda#a41fa0e391cc9e0d6b78ac69ca047a6c +https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2#22dad4df6e8630e8dff2428f6f6a7036 +https://conda.anaconda.org/conda-forge/linux-64/sed-4.8-he412f7d_0.tar.bz2#7362f0042e95681f5d371c46c83ebd08 +https://conda.anaconda.org/conda-forge/linux-64/xorg-kbproto-1.0.7-h7f98852_1002.tar.bz2#4b230e8381279d76131116660f5a241a +https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.1-hd590300_0.conda#b462a33c0be1421532f28bfe8f4a7514 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.11-hd590300_0.conda#2c80dc38fface310c9bd81b17037fee5 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.3-h7f98852_0.tar.bz2#be93aabceefa2fac576e971aef407908 +https://conda.anaconda.org/conda-forge/linux-64/xorg-renderproto-0.11.1-h7f98852_1002.tar.bz2#06feff3d2634e3097ce2fe681474b534 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xextproto-7.3.0-h0b41bf4_1003.conda#bce9f945da8ad2ae9b1d7165a64d0f87 +https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007.tar.bz2#b4a4381d54784606820704f7b5f05a15 +https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 +https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 +https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.13-h59595ed_1003.conda#f87c7b7c2cb45f323ffbce941c78ab7c +https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff +https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2#76bbff344f0134279f225174e9064c8f +https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_11.conda#4c3e460d6acf8e43e4ce8bf405187eb7 +https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a +https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.43-h2797004_0.conda#009981dd9cfcaa4dbfa25ffaed86bcae +https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-13.2.0-h6ddb7a1_11.conda#3227eb98475de9cb375391aa28b931d5 +https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe +https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.16-hd590300_0.conda#151cba22b85a989c2d6ef9633ffee1e4 +https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.44-h0f59acf_0.conda#3914f7ac1761dce57102c72ca7c35d01 +https://conda.anaconda.org/conda-forge/linux-64/pixman-0.43.2-h59595ed_0.conda#71004cbf7924e19c02746ccde9fd7123 +https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 +https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc +https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.4-h7391055_0.conda#93ee23f12bc2e684548181256edd2cf6 +https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda#9653f1bf3766164d0e65fa723cabbc54 +https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda#4d056880988120e29d75bfff282e0f45 +https://conda.anaconda.org/conda-forge/linux-64/bwidget-1.9.14-ha770c72_1.tar.bz2#5746d6202ba2abad4a4707f2a2462795 +https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda#9ae35c3d96db2c94ce0cef86efdfa2cb +https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-13.2.0-h9eb54c0_11.conda#6ba78509a489a8a7882328468f187cc9 +https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844 +https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-h8a4344b_1.conda#9c406bb3d4dac2b358873e6462496d09 +https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.27-pthreads_h413a1c8_0.conda#a356024784da6dfd4683dc5ecf45b155 +https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda#66f03896ffbe1a110ffda05c7a856504 +https://conda.anaconda.org/conda-forge/linux-64/tktable-2.10-h0c5db8f_5.conda#9464044754ea25557a9c93f0327d90a6 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.9-hb711507_1.conda#4a6d410296d7e39f00bacdee7df046e9 +https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.14.2-h14ed4e7_0.conda#0f69b688f52ff6da70bccb7ff7001d1d +https://conda.anaconda.org/conda-forge/linux-64/gfortran_impl_linux-64-13.2.0-h9efe08d_11.conda#d08f638bb8b62d71f2222ecb7003a995 +https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.2.0-h2a599c4_11.conda#c2f0227c9bea564b8edc2f1de939c76d +https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-22_linux64_openblas.conda#1a2a0cd3153464fee6646f3dd6dad9b8 +https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda#f21c27f076a07907e70c49bb57bd0f20 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.4-h0b41bf4_2.conda#82b6df12252e6f32402b96dacc656fec +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.11-hd590300_0.conda#ed67c36f215b310412b2af935bf3e530 +https://conda.anaconda.org/conda-forge/linux-64/xorg-libxt-1.3.0-hd590300_1.conda#ae92aab42726eb29d16488924f7312cb +https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-hbb29018_1.conda#e31a51ddd52326d10a9cc50b0d68daab +https://conda.anaconda.org/conda-forge/linux-64/curl-8.8.0-he654da7_0.conda#042341d8b9ba4ee7f2722b81fae9f0ad +https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-22_linux64_openblas.conda#b083767b6c877e24ee597d93b87ab838 +https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-8.5.0-hfac3d4d_0.conda#f5126317dd0ce0ba26945e411ecc6960 +https://conda.anaconda.org/conda-forge/linux-64/pango-1.54.0-h84a9a3c_0.conda#7c51e110b2f059c0843269d3324e4b22 +https://conda.anaconda.org/conda-forge/linux-64/r-base-4.3.3-h8ee917f_2.conda#fdd20aea0c8243bfa7fb85d144f4febe +https://conda.anaconda.org/conda-forge/noarch/r-renv-1.0.7-r43hc72bb7e_0.conda#efa116dc4d7118a48c97f6f8f4861427 diff --git a/utils/quarto/test/env/renv.yaml b/utils/quarto/test/env/renv.yaml new file mode 100644 index 00000000000..da3620acd40 --- /dev/null +++ b/utils/quarto/test/env/renv.yaml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - nodefaults +dependencies: + - r-renv \ No newline at end of file diff --git a/utils/quarto/test/env/renv_dt.lock b/utils/quarto/test/env/renv_dt.lock new file mode 100644 index 00000000000..13c0acdebee --- /dev/null +++ b/utils/quarto/test/env/renv_dt.lock @@ -0,0 +1,418 @@ +{ + "R": { + "Version": "4.3.3", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cloud.r-project.org" + } + ] + }, + "Packages": { + "R6": { + "Package": "R6", + "Version": "2.5.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.12", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "utils" + ], + "Hash": "5ea2700d21e038ace58269ecdbeb9ec0" + }, + "base64enc": { + "Package": "base64enc", + "Version": "0.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" + }, + "bslib": { + "Package": "bslib", + "Version": "0.7.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "cachem", + "fastmap", + "grDevices", + "htmltools", + "jquerylib", + "jsonlite", + "lifecycle", + "memoise", + "mime", + "rlang", + "sass" + ], + "Hash": "8644cc53f43828f19133548195d7e59e" + }, + "cachem": { + "Package": "cachem", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "fastmap", + "rlang" + ], + "Hash": "cd9a672193789068eb5a2aad65a0dedf" + }, + "cli": { + "Package": "cli", + "Version": "3.6.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" + }, + "data.table": { + "Package": "data.table", + "Version": "1.15.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "8ee9ac56ef633d0c7cab8b2ca87d683e" + }, + "digest": { + "Package": "digest", + "Version": "0.6.35", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31" + }, + "evaluate": { + "Package": "evaluate", + "Version": "0.24.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "htmltools", + "rlang" + ], + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" + }, + "fs": { + "Package": "fs", + "Version": "1.6.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" + }, + "glue": { + "Package": "glue", + "Version": "1.7.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "e0b3a53876554bd45879e596cdb10a52" + }, + "highr": { + "Package": "highr", + "Version": "0.11", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "xfun" + ], + "Hash": "d65ba49117ca223614f71b60d85b8ab7" + }, + "htmltools": { + "Package": "htmltools", + "Version": "0.5.8.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "digest", + "fastmap", + "grDevices", + "rlang", + "utils" + ], + "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" + }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "htmltools" + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "1.8.8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods" + ], + "Hash": "e1b9c55281c5adc4dd113652d9e26768" + }, + "knitr": { + "Package": "knitr", + "Version": "1.47", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "evaluate", + "highr", + "methods", + "tools", + "xfun", + "yaml" + ], + "Hash": "7c99b2d55584b982717fcc0950378612" + }, + "later": { + "Package": "later", + "Version": "1.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Rcpp", + "rlang" + ], + "Hash": "a3e051d405326b8b0012377434c62b37" + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.4", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "glue", + "rlang" + ], + "Hash": "b8552d117e1b808b09a832f589b79035" + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "cachem", + "rlang" + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" + }, + "mime": { + "Package": "mime", + "Version": "0.12", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" + }, + "processx": { + "Package": "processx", + "Version": "3.8.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "ps", + "utils" + ], + "Hash": "0c90a7d71988856bad2a2a45dd871bb9" + }, + "ps": { + "Package": "ps", + "Version": "1.7.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "dd2b9319ee0656c8acf45c7f40c59de7" + }, + "quarto": { + "Package": "quarto", + "Version": "1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "jsonlite", + "later", + "processx", + "rlang", + "rmarkdown", + "rstudioapi", + "tools", + "utils", + "yaml" + ], + "Hash": "c94c271f9b998d116186a78b2a9b23c1" + }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" + }, + "renv": { + "Package": "renv", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "397b7b2a265bc5a7a06852524dabae20" + }, + "rlang": { + "Package": "rlang", + "Version": "1.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" + }, + "rmarkdown": { + "Package": "rmarkdown", + "Version": "2.27", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bslib", + "evaluate", + "fontawesome", + "htmltools", + "jquerylib", + "jsonlite", + "knitr", + "methods", + "tinytex", + "tools", + "utils", + "xfun", + "yaml" + ], + "Hash": "27f9502e1cdbfa195f94e03b0f517484" + }, + "rstudioapi": { + "Package": "rstudioapi", + "Version": "0.16.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "96710351d642b70e8f02ddeb237c46a7" + }, + "sass": { + "Package": "sass", + "Version": "0.4.9", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "fs", + "htmltools", + "rappdirs", + "rlang" + ], + "Hash": "d53dbfddf695303ea4ad66f86e99b95d" + }, + "tinytex": { + "Package": "tinytex", + "Version": "0.51", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "xfun" + ], + "Hash": "d44e2fcd2e4e076f0aac540208559d1d" + }, + "xfun": { + "Package": "xfun", + "Version": "0.45", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "stats", + "tools" + ], + "Hash": "ca59c87fe305b16a9141a5874c3a7889" + }, + "yaml": { + "Package": "yaml", + "Version": "2.3.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "29240487a071f535f5e5d5a323b7afbd" + } + } +} diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py index 8a06d23e95c..dfc2c0288ff 100644 --- a/utils/quarto/wrapper.py +++ b/utils/quarto/wrapper.py @@ -77,7 +77,7 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: out_report_rendered = out_report report_path = f"{out_report}.tmp" else: - # In case an output is specified, + # In case an output is specified, # the output is created in the target folder. report_path = Path(report).resolve() # The report to-be-rendered is namespaced @@ -95,7 +95,8 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: " via conda: https://github.com/conda-forge/quarto-feedstock/issues/26" ) args += f" --to={report_path.suffix[1:]}" - shell(""" + shell( + """ # copy the input script to prevent name clashes cp {script} {out_report} WD=$(pwd) @@ -107,4 +108,5 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: {log} # move the output to the final destination mv {out_report_rendered} {report_path} - """) + """ + ) From 9423bd60d2b26b01fee93710ccbabc6fd8d62c50 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 09:33:55 +0200 Subject: [PATCH 06/18] Fix meta.yml rendering errors --- utils/quarto/meta.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index 7f03a83c498..a9eb3a358cd 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -21,7 +21,7 @@ input: If this needs to be changed, change the `conda:` parameter to point to an appropriate conda environment. Default: the project root directory - - ``: > + - additional_inputs: > Additional input files. These the paths will be passed as `params:` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr output: @@ -30,21 +30,21 @@ output: Path to the rendered report. The file extension will be used to determine the output format (eg `report.html`, `report.docx`). PDF rendering is currently not supported due to the lack of support of tinytex in conda-forge. If not provided, the report will be rendered in a temporary directory and no output will be returned. - - `: > + - additional_outputs: > Additional output files. These the paths will be passed as `params:` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr params: - - `: > - Additional parameters to be passed to the quarto script. These the paths will be passed as `params:` to the quarto script + - additional_params: > + Additional parameters to be passed to the quarto script. These the paths will be passed as `params:` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr If wildcards/threads should be passed to the `quarto` script, use a function to pass it in params: ``` params: - project: lambda wc: wc.project` + project: lambda wc: wc.project threads: lambda wc, threads: threads mem: lambda wc, resources: resources.mem - ``` + will be passed to quarto render as `-P project=project -P threads=threads -P mem=mem` notes: | This wrapper runs quarto to render markdown .qmd notebooks. It supports r-package management via conda and renv, as illustrated in the examples. From 98019c462370ed945b6ab6c24e81ad3ffb6ce0eb Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 09:45:17 +0200 Subject: [PATCH 07/18] Add tests for quarto wrapper --- test.py | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/test.py b/test.py index 605462538c0..a0191934a68 100644 --- a/test.py +++ b/test.py @@ -6686,3 +6686,101 @@ def test_emu_combine_output_split(): "-F", ], ) + + +@skip_if_not_modified +def test_quarto_simple_html(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/simple.html", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_html(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/simple.html", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_docx(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/simple.docx", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_parameters(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/example_proj_full.html", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_noreport(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/example_proj_noreport.txt", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_extra_conda_deps(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/extra_datatable_conda.html", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_simple_extra_renv_deps(): + run( + "bio/emu/combine-outputs", + [ + "snakemake", + "--cores", + "1", + "output/extra_datatable_renv.html", + "--use-conda", + ], + ) From 6f5d86bfe1f08b8917ebacb8da6f08109b407695 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 09:50:50 +0200 Subject: [PATCH 08/18] Pin quarto version --- utils/quarto/environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/quarto/environment.yaml b/utils/quarto/environment.yaml index 76620d0b3ee..dacd6737517 100644 --- a/utils/quarto/environment.yaml +++ b/utils/quarto/environment.yaml @@ -2,4 +2,4 @@ channels: - conda-forge - nodefaults dependencies: - - r-quarto \ No newline at end of file + - r-quarto=1.4 \ No newline at end of file From 1ece336587c2e5d7233e861be4e59311f7b5f33b Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 11:24:00 +0200 Subject: [PATCH 09/18] Pin the versions in the test environments Generally these should not need to be updated. If updating renv.yaml, the renv_dt.lock file needs to be adapted as well. --- utils/quarto/test/env/extra.yaml | 4 ++-- utils/quarto/test/env/renv.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/quarto/test/env/extra.yaml b/utils/quarto/test/env/extra.yaml index 9def1b92e4e..251ad74ad97 100644 --- a/utils/quarto/test/env/extra.yaml +++ b/utils/quarto/test/env/extra.yaml @@ -1,6 +1,6 @@ channels: - conda-forge dependencies: - - r-quarto - - r-data.table + - r-quarto=1.4 + - r-data.table=1.15.4 diff --git a/utils/quarto/test/env/renv.yaml b/utils/quarto/test/env/renv.yaml index da3620acd40..23355a5c8b1 100644 --- a/utils/quarto/test/env/renv.yaml +++ b/utils/quarto/test/env/renv.yaml @@ -2,4 +2,5 @@ channels: - conda-forge - nodefaults dependencies: - - r-renv \ No newline at end of file + - r-base=4.3.3 + - r-renv=1.0.7 \ No newline at end of file From 8a01c7eb017dac68ca82a3efe2c92f868249dee4 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 11:47:35 +0200 Subject: [PATCH 10/18] Fix wrong folder for quarto tests --- test.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/test.py b/test.py index a0191934a68..ebe22f23c95 100644 --- a/test.py +++ b/test.py @@ -6691,7 +6691,7 @@ def test_emu_combine_output_split(): @skip_if_not_modified def test_quarto_simple_html(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", @@ -6702,24 +6702,11 @@ def test_quarto_simple_html(): ) -@skip_if_not_modified -def test_quarto_simple_html(): - run( - "bio/emu/combine-outputs", - [ - "snakemake", - "--cores", - "1", - "output/simple.html", - "--use-conda", - ], - ) - @skip_if_not_modified def test_quarto_simple_docx(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", @@ -6733,7 +6720,7 @@ def test_quarto_simple_docx(): @skip_if_not_modified def test_quarto_simple_parameters(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", @@ -6747,7 +6734,7 @@ def test_quarto_simple_parameters(): @skip_if_not_modified def test_quarto_simple_noreport(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", @@ -6761,7 +6748,7 @@ def test_quarto_simple_noreport(): @skip_if_not_modified def test_quarto_simple_extra_conda_deps(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", @@ -6775,7 +6762,7 @@ def test_quarto_simple_extra_conda_deps(): @skip_if_not_modified def test_quarto_simple_extra_renv_deps(): run( - "bio/emu/combine-outputs", + "utils/quarto", [ "snakemake", "--cores", From 2207ff9fe7466904a5444a426b3019f7903981f3 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Fri, 21 Jun 2024 13:25:14 +0200 Subject: [PATCH 11/18] Fix test refering to ../environment.yml --- utils/quarto/test/Snakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/quarto/test/Snakefile b/utils/quarto/test/Snakefile index d265e31f73f..431acc37700 100644 --- a/utils/quarto/test/Snakefile +++ b/utils/quarto/test/Snakefile @@ -112,7 +112,7 @@ rule renv_example_init: rule restore_renv: conda: - "../environment.yaml" + "env/renv.yaml" input: rprofile="{renv_dir}.Rprofile", lock="{renv_dir}renv.lock", From 97e1928f67e27b860f99cbc4121cbb735664b7ed Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Sat, 22 Jun 2024 06:27:52 +0200 Subject: [PATCH 12/18] Remove the conda r-dependency example As discussed in the PR this does not need to be explicitly shown. Instead I have added this more expliiclty to the documentation. --- test.py | 13 -- utils/quarto/meta.yaml | 12 +- utils/quarto/test/.gitignore | 9 -- utils/quarto/test/Snakefile | 31 +++-- utils/quarto/test/env/extra.linux-64.pin.txt | 139 ------------------- utils/quarto/test/env/extra.yaml | 6 - 6 files changed, 28 insertions(+), 182 deletions(-) delete mode 100644 utils/quarto/test/.gitignore delete mode 100644 utils/quarto/test/env/extra.linux-64.pin.txt delete mode 100644 utils/quarto/test/env/extra.yaml diff --git a/test.py b/test.py index ebe22f23c95..e2a9ccada4c 100644 --- a/test.py +++ b/test.py @@ -6745,19 +6745,6 @@ def test_quarto_simple_noreport(): ) -@skip_if_not_modified -def test_quarto_simple_extra_conda_deps(): - run( - "utils/quarto", - [ - "snakemake", - "--cores", - "1", - "output/extra_datatable_conda.html", - "--use-conda", - ], - ) - @skip_if_not_modified def test_quarto_simple_extra_renv_deps(): diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index a9eb3a358cd..909980f9677 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -46,6 +46,12 @@ params: ``` will be passed to quarto render as `-P project=project -P threads=threads -P mem=mem` notes: | - This wrapper runs quarto to render markdown .qmd notebooks. It supports r-package management via conda and renv, as illustrated - in the examples. - PDF rendering is currently not working. \ No newline at end of file + This wrapper runs quarto to render markdown .qmd notebooks. + It supports r-package management via `conda` and `renv`: + - For `conda` overwrite the conda environment from the `conda:` directive of the rule with an environement with + the r dependencies as well as `r-quarto` installed. + - For `renv` restore an environment before and point the `input.renv` + to the environment folder or a file within (eg `.Rprofile`). The r-version needs used to build the `renv` needs to match + the one of the wrapper or the environment of the wrapper needs to be overwritten with via `conda:` with a matching `r-base` + installation. + PDF rendering is currently not working as tinytex is not properly supported in `conda`. \ No newline at end of file diff --git a/utils/quarto/test/.gitignore b/utils/quarto/test/.gitignore deleted file mode 100644 index 03c0d3a687b..00000000000 --- a/utils/quarto/test/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -example_proj* -logs/ -env/renv_test -*_files/ -*_input.txt -*_output.txt -*.docx -*.html -output/ \ No newline at end of file diff --git a/utils/quarto/test/Snakefile b/utils/quarto/test/Snakefile index 431acc37700..7ff0e0e701d 100644 --- a/utils/quarto/test/Snakefile +++ b/utils/quarto/test/Snakefile @@ -7,7 +7,6 @@ rule all: # [hide] "output/simple.docx", # [hide] "output/example_proj_full.html", # [hide] "output/example_proj_noreport.txt", # [hide] - "output/extra_datatable_conda.html", # [hide] "output/extra_datatable_renv.html", # [hide] @@ -65,17 +64,21 @@ rule render_quarto_noreport: "master/utils/quarto" -rule render_quarto_extra_conda: - conda: - "env/extra.yaml" - input: - script="extra_datatable.qmd", - output: - report="output/extra_datatable_conda.html", - log: - "logs/conda.log", - wrapper: - "master/utils/quarto" +# To add additional r-dependencies used to render +# the report also the conda: directive can be +# overwritten. The only required dependency +# is r-quarto +# rule render_quarto_extra_conda: +# conda: +# "env/extra.yaml" +# input: +# script="extra_datatable.qmd", +# output: +# report="output/extra_datatable_conda.html", +# log: +# "logs/conda.log", +# wrapper: +# "master/utils/quarto" # Rules for a example using renv @@ -130,6 +133,10 @@ rule restore_renv: rule render_quarto_renv: + # If the renv is build using a different r version + # than the wrapper, the "conda:" directive may can be overwritten + # using an environment with the correct "r-base" & "r-conda" + # installed input: script="extra_datatable.qmd", renv="env/renv_test/restored.Rprofile", diff --git a/utils/quarto/test/env/extra.linux-64.pin.txt b/utils/quarto/test/env/extra.linux-64.pin.txt deleted file mode 100644 index 2f0a7ae48a0..00000000000 --- a/utils/quarto/test/env/extra.linux-64.pin.txt +++ /dev/null @@ -1,139 +0,0 @@ -# This file may be used to create an environment using: -# $ conda create --name --file -# platform: linux-64 -@EXPLICIT -https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81 -https://conda.anaconda.org/conda-forge/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2#19f9db5f4f1b7f5ef5f6d67207f25f38 -https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.6.2-hbcca054_0.conda#847c3c2905cc467cea52c24f9cfa8080 -https://conda.anaconda.org/conda-forge/linux-64/dart-sass-1.58.3-ha770c72_1.conda#d54982a58cd9be3d00a7efe76ba6f60c -https://conda.anaconda.org/conda-forge/linux-64/esbuild-0.19.2-ha770c72_0.conda#8fa87b764cf6143cb66e9cc3548b186a -https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2#0c96522c6bdaed4b1566d11387caaf45 -https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2#34893075a5c9e55cdafac56607368fc6 -https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2#4d59c254e01d9cde7957100457e2d5fb -https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_2.conda#cbbe59391138ea5ad3658c76912e147f -https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda#d731b543793afc0433c4fd593e693fce -https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-hf3520f5_7.conda#b80f2f396ca2c28b8c14c437a4ed1e74 -https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-13.2.0-hdb50d1a_111.conda#43178c27fac2dcd495bd9e58e18272d9 -https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-13.2.0-hdb50d1a_111.conda#4ffa92ea4ba6555dee156ce3d0ae7a9b -https://conda.anaconda.org/conda-forge/linux-64/pandoc-3.1.11.1-ha770c72_0.conda#0e2f14aff42adf4675bcd5335d644a5f -https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2#f766549260d6815b0c52253f1fb1bb29 -https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_11.conda#8c462ced2af33648195dc9459f331f31 -https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda#595db67e32b276298ff3d94d07d47fbf -https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d -https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-ha1999f0_7.conda#3f840c7ed70a96b5ebde8044b2f36f32 -https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2#fee5683a3f04bd15cbd8318b096a27ab -https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_11.conda#0b3b218a596bb4c3854cc9ee799f94e5 -https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda#69b8b6202a07720f448be700e300ccf4 -https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.28.1-hd590300_0.conda#dcde58ff9a1f30b0037a2315d1846d1f -https://conda.anaconda.org/conda-forge/linux-64/deno-1.37.2-h335b0a9_1.conda#50fe6d0064adfd83846a6f9c87da03e3 -https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.10-h36c2ea0_0.tar.bz2#ac7bc6a654f8f41b352b38f4051135f8 -https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2#30186d27e2c9fa62b45fb1476b7200e3 -https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda#8e88f9389f1165d7c0936fe40d9a9a79 -https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055 -https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda#e7ba12deb7020dd080c6c70e7b6f6a3d -https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2#d645c6d2ac96843a2bfaccd2d62b3ac3 -https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_11.conda#c485da4fdb454539f852a90ae06e9bb7 -https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda#d66573916ffcf376178462f1b61c941e -https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda#ea25936bb4080d843790b586850f82b8 -https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_11.conda#eaa8ea74083fb4a78ae19e431e556003 -https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda#40b61aab5c7ba9ff276c41cfffe6b80b -https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.4.0-hd590300_0.conda#b26e8aa824079e1be0294e7152ca4559 -https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-h4ab18f5_1.conda#57d7dc60e9325e3de37ff8dffd18e814 -https://conda.anaconda.org/conda-forge/linux-64/make-4.3-hd18ef5c_1.tar.bz2#4049ebfd3190b580dffe76daed26155a -https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h59595ed_0.conda#fcea371545eda051b6deafb24889fc69 -https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.1-h4ab18f5_0.conda#a41fa0e391cc9e0d6b78ac69ca047a6c -https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2#22dad4df6e8630e8dff2428f6f6a7036 -https://conda.anaconda.org/conda-forge/linux-64/sed-4.8-he412f7d_0.tar.bz2#7362f0042e95681f5d371c46c83ebd08 -https://conda.anaconda.org/conda-forge/linux-64/xorg-kbproto-1.0.7-h7f98852_1002.tar.bz2#4b230e8381279d76131116660f5a241a -https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.1-hd590300_0.conda#b462a33c0be1421532f28bfe8f4a7514 -https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.11-hd590300_0.conda#2c80dc38fface310c9bd81b17037fee5 -https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.3-h7f98852_0.tar.bz2#be93aabceefa2fac576e971aef407908 -https://conda.anaconda.org/conda-forge/linux-64/xorg-renderproto-0.11.1-h7f98852_1002.tar.bz2#06feff3d2634e3097ce2fe681474b534 -https://conda.anaconda.org/conda-forge/linux-64/xorg-xextproto-7.3.0-h0b41bf4_1003.conda#bce9f945da8ad2ae9b1d7165a64d0f87 -https://conda.anaconda.org/conda-forge/linux-64/xorg-xproto-7.0.31-h7f98852_1007.tar.bz2#b4a4381d54784606820704f7b5f05a15 -https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2#2161070d867d1b1204ea749c8eec4ef0 -https://conda.anaconda.org/conda-forge/linux-64/deno-dom-0.1.35-hd9586b0_1.conda#263ee0870b18b013d9ec8539113ac69f -https://conda.anaconda.org/conda-forge/linux-64/expat-2.6.2-h59595ed_0.conda#53fb86322bdb89496d7579fe3f02fd61 -https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.13-h59595ed_1003.conda#f87c7b7c2cb45f323ffbce941c78ab7c -https://conda.anaconda.org/conda-forge/linux-64/icu-73.2-h59595ed_0.conda#cc47e1facc155f91abd89b11e48e72ff -https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2#76bbff344f0134279f225174e9064c8f -https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2#4d331e44109e3f0e19b4cb8f9b82f3e1 -https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_11.conda#4c3e460d6acf8e43e4ce8bf405187eb7 -https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.58.0-h47da74e_1.conda#700ac6ea6d53d5510591c4344d5c989a -https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.43-h2797004_0.conda#009981dd9cfcaa4dbfa25ffaed86bcae -https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-13.2.0-h6ddb7a1_11.conda#3227eb98475de9cb375391aa28b931d5 -https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda#1f5a58e686b13bcfde88b93f547d23fe -https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.16-hd590300_0.conda#151cba22b85a989c2d6ef9633ffee1e4 -https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.44-h0f59acf_0.conda#3914f7ac1761dce57102c72ca7c35d01 -https://conda.anaconda.org/conda-forge/linux-64/pixman-0.43.2-h59595ed_0.conda#71004cbf7924e19c02746ccde9fd7123 -https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda#47d31b792659ce70f470b5c82fdfb7a4 -https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda#d453b98d9c83e71da0741bb0ff4d76bc -https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.4-h7391055_0.conda#93ee23f12bc2e684548181256edd2cf6 -https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-h4ab18f5_1.conda#9653f1bf3766164d0e65fa723cabbc54 -https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda#4d056880988120e29d75bfff282e0f45 -https://conda.anaconda.org/conda-forge/linux-64/bwidget-1.9.14-ha770c72_1.tar.bz2#5746d6202ba2abad4a4707f2a2462795 -https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda#9ae35c3d96db2c94ce0cef86efdfa2cb -https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-13.2.0-h9eb54c0_11.conda#6ba78509a489a8a7882328468f187cc9 -https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda#cd95826dbd331ed1be26bdf401432844 -https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-h8a4344b_1.conda#9c406bb3d4dac2b358873e6462496d09 -https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.27-pthreads_h413a1c8_0.conda#a356024784da6dfd4683dc5ecf45b155 -https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda#66f03896ffbe1a110ffda05c7a856504 -https://conda.anaconda.org/conda-forge/linux-64/quarto-1.4.550-ha770c72_1.conda#b7b89be76bcdab239f7956e5fc2727ab -https://conda.anaconda.org/conda-forge/linux-64/tktable-2.10-h0c5db8f_5.conda#9464044754ea25557a9c93f0327d90a6 -https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.9-hb711507_1.conda#4a6d410296d7e39f00bacdee7df046e9 -https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.14.2-h14ed4e7_0.conda#0f69b688f52ff6da70bccb7ff7001d1d -https://conda.anaconda.org/conda-forge/linux-64/gfortran_impl_linux-64-13.2.0-h9efe08d_11.conda#d08f638bb8b62d71f2222ecb7003a995 -https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-13.2.0-h2a599c4_11.conda#c2f0227c9bea564b8edc2f1de939c76d -https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-22_linux64_openblas.conda#1a2a0cd3153464fee6646f3dd6dad9b8 -https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda#f21c27f076a07907e70c49bb57bd0f20 -https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.4-h0b41bf4_2.conda#82b6df12252e6f32402b96dacc656fec -https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.11-hd590300_0.conda#ed67c36f215b310412b2af935bf3e530 -https://conda.anaconda.org/conda-forge/linux-64/xorg-libxt-1.3.0-hd590300_1.conda#ae92aab42726eb29d16488924f7312cb -https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-hbb29018_1.conda#e31a51ddd52326d10a9cc50b0d68daab -https://conda.anaconda.org/conda-forge/linux-64/curl-8.8.0-he654da7_0.conda#042341d8b9ba4ee7f2722b81fae9f0ad -https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-22_linux64_openblas.conda#b083767b6c877e24ee597d93b87ab838 -https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-8.5.0-hfac3d4d_0.conda#f5126317dd0ce0ba26945e411ecc6960 -https://conda.anaconda.org/conda-forge/linux-64/pango-1.54.0-h84a9a3c_0.conda#7c51e110b2f059c0843269d3324e4b22 -https://conda.anaconda.org/conda-forge/linux-64/r-base-4.3.3-h8ee917f_2.conda#fdd20aea0c8243bfa7fb85d144f4febe -https://conda.anaconda.org/conda-forge/linux-64/r-base64enc-0.1_3-r43h57805ef_1006.conda#3cb46d4c0d2096491f9934da0e1555ee -https://conda.anaconda.org/conda-forge/linux-64/r-cli-3.6.2-r43ha503ecb_0.conda#7a325f68b1354c1a5261688b5e54d008 -https://conda.anaconda.org/conda-forge/linux-64/r-curl-5.1.0-r43hf9611b0_0.conda#d2a3cc302656e5ff30fc635fd9ef3ae6 -https://conda.anaconda.org/conda-forge/linux-64/r-data.table-1.15.4-r43ha8f4200_0.conda#7f80fa5300b292c19bab54674884e233 -https://conda.anaconda.org/conda-forge/linux-64/r-digest-0.6.35-r43ha503ecb_0.conda#d28a7db9b060ceaf683f0b036780b962 -https://conda.anaconda.org/conda-forge/noarch/r-evaluate-0.24.0-r43hc72bb7e_0.conda#1c3aa7ca297fae40ea8d6a8fe78317f0 -https://conda.anaconda.org/conda-forge/linux-64/r-fastmap-1.2.0-r43ha18555a_0.conda#f60a0e293418fc91b73bd67aa62d4a79 -https://conda.anaconda.org/conda-forge/linux-64/r-fs-1.6.4-r43ha18555a_0.conda#c0cc6b111eb64c8d21f4feeb53c8d06d -https://conda.anaconda.org/conda-forge/linux-64/r-glue-1.7.0-r43h57805ef_0.conda#20e2cb7c0d27bccf8fe21ec5c3897751 -https://conda.anaconda.org/conda-forge/linux-64/r-jsonlite-1.8.8-r43h57805ef_0.conda#fb01953d78a87de6211b1ebccafed273 -https://conda.anaconda.org/conda-forge/linux-64/r-mime-0.12-r43h57805ef_2.conda#348f6adefce6912321b2a2ab0528ae89 -https://conda.anaconda.org/conda-forge/noarch/r-packrat-0.9.2-r43hc72bb7e_0.conda#acc0bee43ed5a63ef521aa6995541e97 -https://conda.anaconda.org/conda-forge/linux-64/r-ps-1.7.6-r43h57805ef_0.conda#48f9e73215aa6de4545ec3ec36e5e534 -https://conda.anaconda.org/conda-forge/noarch/r-r6-2.5.1-r43hc72bb7e_2.conda#79f167972554dc6b65aa099cd85c22a1 -https://conda.anaconda.org/conda-forge/linux-64/r-rappdirs-0.3.3-r43h57805ef_2.conda#788ac4f3dcfa79520bfc9eeadf50c2eb -https://conda.anaconda.org/conda-forge/linux-64/r-rcpp-1.0.12-r43h7df8631_0.conda#a8aac8be0868617b28f27484ea548d6c -https://conda.anaconda.org/conda-forge/noarch/r-renv-1.0.7-r43hc72bb7e_0.conda#efa116dc4d7118a48c97f6f8f4861427 -https://conda.anaconda.org/conda-forge/linux-64/r-rlang-1.1.4-r43ha18555a_0.conda#74c4cb6644843dccabc350cba4b56ec6 -https://conda.anaconda.org/conda-forge/noarch/r-rstudioapi-0.16.0-r43hc72bb7e_0.conda#02c7b3c36e390b0c538300adab8ca3eb -https://conda.anaconda.org/conda-forge/linux-64/r-sys-3.4.2-r43h57805ef_1.conda#ae6e4dd935d9c91064cbca07d2769d75 -https://conda.anaconda.org/conda-forge/linux-64/r-xfun-0.45-r43ha18555a_0.conda#cced29e73709a7c9b2495a4f5d695d66 -https://conda.anaconda.org/conda-forge/linux-64/r-yaml-2.3.8-r43h57805ef_0.conda#41db1ee9d0073339e681379b92e7dfb6 -https://conda.anaconda.org/conda-forge/linux-64/r-askpass-1.2.0-r43h57805ef_0.conda#ee095f1d72a1d80864816e44623ba392 -https://conda.anaconda.org/conda-forge/linux-64/r-cachem-1.1.0-r43hb1dbf0f_0.conda#d48720030e2b1d780389bafa5a9c7536 -https://conda.anaconda.org/conda-forge/linux-64/r-ellipsis-0.3.2-r43h57805ef_2.conda#10c5892991072cfa3a61489d2ac6ad66 -https://conda.anaconda.org/conda-forge/noarch/r-highr-0.11-r43hc72bb7e_0.conda#ecd3b95a01caa7bdcf63714427b5b88c -https://conda.anaconda.org/conda-forge/linux-64/r-later-1.3.2-r43ha503ecb_0.conda#6e120827a341f21444881e84408e98a7 -https://conda.anaconda.org/conda-forge/noarch/r-lifecycle-1.0.4-r43hc72bb7e_0.conda#291d2fb68ea1b181644b40d6743ae000 -https://conda.anaconda.org/conda-forge/linux-64/r-pki-0.1_14-r43hb1dbf0f_0.conda#58c4dc882730c0d96ca09e58be0150d8 -https://conda.anaconda.org/conda-forge/linux-64/r-processx-3.8.4-r43h57805ef_0.conda#660d4e9ff8beef35dbda645484d17a25 -https://conda.anaconda.org/conda-forge/noarch/r-tinytex-0.51-r43hc72bb7e_0.conda#16653f65f1ab934e1a9bdac874f9b63b -https://conda.anaconda.org/conda-forge/linux-64/r-htmltools-0.5.8.1-r43ha503ecb_0.conda#220b9c45f5867a42d49bde8d340e9e53 -https://conda.anaconda.org/conda-forge/noarch/r-knitr-1.47-r43hc72bb7e_0.conda#0310660d998a5933bb4545a312ed7385 -https://conda.anaconda.org/conda-forge/noarch/r-memoise-2.0.1-r43hc72bb7e_2.conda#6520452e207d8f9bab9f21492f88c48b -https://conda.anaconda.org/conda-forge/linux-64/r-openssl-2.2.0-r43hd7d0243_0.conda#60f961514ecc3ee1fd7b1afd6ea853ab -https://conda.anaconda.org/conda-forge/noarch/r-fontawesome-0.5.2-r43hc72bb7e_0.conda#d07f215759462959de39d7232386f1b9 -https://conda.anaconda.org/conda-forge/noarch/r-jquerylib-0.1.4-r43hc72bb7e_2.conda#49a3fad710cbccec9139b36587842f88 -https://conda.anaconda.org/conda-forge/noarch/r-rsconnect-1.3.1-r43hc72bb7e_0.conda#474409574da3aacf988008567cbf11b7 -https://conda.anaconda.org/conda-forge/linux-64/r-sass-0.4.9-r43ha503ecb_0.conda#58e32ad6d979828aa0fc3da59e1b4d78 -https://conda.anaconda.org/conda-forge/noarch/r-bslib-0.7.0-r43hc72bb7e_0.conda#6e2bfdc782284259390d09bb083142b2 -https://conda.anaconda.org/conda-forge/noarch/r-rmarkdown-2.27-r43hc72bb7e_1.conda#4b681e35650d7d10737bc0c6ed80ae9a -https://conda.anaconda.org/conda-forge/noarch/r-quarto-1.4-r43hc72bb7e_0.conda#a86d89513116deba7cc3c6e8e72a0f61 diff --git a/utils/quarto/test/env/extra.yaml b/utils/quarto/test/env/extra.yaml deleted file mode 100644 index 251ad74ad97..00000000000 --- a/utils/quarto/test/env/extra.yaml +++ /dev/null @@ -1,6 +0,0 @@ -channels: - - conda-forge -dependencies: - - r-quarto=1.4 - - r-data.table=1.15.4 - From 1d1515a6e462a634224a7abf02341a8ac4cee26b Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Sat, 22 Jun 2024 07:46:20 +0200 Subject: [PATCH 13/18] Handle case where not log file defined Before this would have raised an error `log` not defined --- utils/quarto/wrapper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py index dfc2c0288ff..06969b9167c 100644 --- a/utils/quarto/wrapper.py +++ b/utils/quarto/wrapper.py @@ -66,6 +66,8 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: if logfile: snakemake.log = str(Path(str(logfile)).resolve()) log = snakemake.log_fmt_shell(stdout=True, stderr=True) +else: + log = "" args = " ".join(params) From 0985231c4551c2c51e713e244643df8e4fedfb39 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Mon, 24 Jun 2024 15:22:03 +0200 Subject: [PATCH 14/18] Add Quarto url Co-authored-by: Filipe G. Vieira <1151762+fgvieira@users.noreply.github.com> --- utils/quarto/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index 909980f9677..c93f672c5e8 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -1,5 +1,6 @@ name: quarto description: Render quarto markdown documents +url: https://github.com/quarto-dev/quarto-r authors: -Vito Zanotelli input: From a2b6704e348652f7ca84725816509abcd082f3e5 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Mon, 8 Jul 2024 17:52:44 +0200 Subject: [PATCH 15/18] Add tests for resource passing As suggested resources that match the name should be automatically passed. Tests added: - test if a custom resource added will be passed - test if the special resource 'threads' will be passed --- test.py | 57 ++++++++++++++++++++++--- utils/quarto/test/Snakefile | 25 +++++++++++ utils/quarto/test/resources_custom.qmd | 15 +++++++ utils/quarto/test/resources_threads.qmd | 16 +++++++ 4 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 utils/quarto/test/resources_custom.qmd create mode 100644 utils/quarto/test/resources_threads.qmd diff --git a/test.py b/test.py index 79ab68fc3d3..b4764778596 100644 --- a/test.py +++ b/test.py @@ -5602,7 +5602,14 @@ def test_ensembl_annotation_gtf_gz(): def test_ensembl_regulatory_gff3_gz(): run( "bio/reference/ensembl-regulation", - ["snakemake", "--cores", "1", "resources/regulatory_features.gff3.gz", "--use-conda", "-F"], + [ + "snakemake", + "--cores", + "1", + "resources/regulatory_features.gff3.gz", + "--use-conda", + "-F", + ], ) @@ -5610,7 +5617,14 @@ def test_ensembl_regulatory_gff3_gz(): def test_ensembl_regulatory_features_grch37_gff(): run( "bio/reference/ensembl-regulation", - ["snakemake", "--cores", "1", "resources/regulatory_features.gff", "--use-conda", "-F"], + [ + "snakemake", + "--cores", + "1", + "resources/regulatory_features.gff", + "--use-conda", + "-F", + ], ) @@ -5618,7 +5632,14 @@ def test_ensembl_regulatory_features_grch37_gff(): def test_ensembl_regulatory_features_mouse_gff_gz(): run( "bio/reference/ensembl-regulation", - ["snakemake", "--cores", "1", "resources/regulatory_features.mouse.gff.gz", "--use-conda", "-F"], + [ + "snakemake", + "--cores", + "1", + "resources/regulatory_features.mouse.gff.gz", + "--use-conda", + "-F", + ], ) @@ -6726,7 +6747,6 @@ def test_quarto_simple_html(): ) - @skip_if_not_modified def test_quarto_simple_docx(): run( @@ -6769,7 +6789,6 @@ def test_quarto_simple_noreport(): ) - @skip_if_not_modified def test_quarto_simple_extra_renv_deps(): run( @@ -6782,3 +6801,31 @@ def test_quarto_simple_extra_renv_deps(): "--use-conda", ], ) + + +@skip_if_not_modified +def test_quarto_pass_resources(): + run( + "utils/quarto", + [ + "snakemake", + "--cores", + "1", + "output/resources_custom.html", + "--use-conda", + ], + ) + + +@skip_if_not_modified +def test_quarto_pass_threads(): + run( + "utils/quarto", + [ + "snakemake", + "--cores", + "1", + "output/resources_threads.html", + "--use-conda", + ], + ) diff --git a/utils/quarto/test/Snakefile b/utils/quarto/test/Snakefile index 7ff0e0e701d..3920b4ff887 100644 --- a/utils/quarto/test/Snakefile +++ b/utils/quarto/test/Snakefile @@ -4,6 +4,7 @@ import os rule all: # [hide] input: # [hide] "output/simple.html", # [hide] + "output/resources.html", # [hide] "output/simple.docx", # [hide] "output/example_proj_full.html", # [hide] "output/example_proj_noreport.txt", # [hide] @@ -64,6 +65,30 @@ rule render_quarto_noreport: "master/utils/quarto" +rule pass_custom_resources: + input: + script="resources_custom.qmd", + output: + report="output/resources_custom.html", + resources: + custom_resource=1, + log: + "logs/pass_custom_resources.log", + wrapper: + "master/utils/quarto" + + +rule pass_threads: + input: + script="resources_threads.qmd", + output: + report="output/resources_threads.html", + log: + "logs/pass_threads.log", + wrapper: + "master/utils/quarto" + + # To add additional r-dependencies used to render # the report also the conda: directive can be # overwritten. The only required dependency diff --git a/utils/quarto/test/resources_custom.qmd b/utils/quarto/test/resources_custom.qmd new file mode 100644 index 00000000000..ddda5d745e6 --- /dev/null +++ b/utils/quarto/test/resources_custom.qmd @@ -0,0 +1,15 @@ +--- +title: "Quarto resource passing example" +author: "Vito Zanotelli, University Children's Hospital Zurich" +format: html +params: + resources_custom_resource: NULL +--- + + +```{r} +#| label: Verify that resource custom_resource is passed +if (is.null(params$resources_custom_resource)){ + stop('resource "custom_resource" not passed to report') +} +``` \ No newline at end of file diff --git a/utils/quarto/test/resources_threads.qmd b/utils/quarto/test/resources_threads.qmd new file mode 100644 index 00000000000..d3ab453ca26 --- /dev/null +++ b/utils/quarto/test/resources_threads.qmd @@ -0,0 +1,16 @@ +--- +title: "Quarto resource passing example" +author: "Vito Zanotelli, University Children's Hospital Zurich" +format: html +params: + resources_threads: NULL +--- + + +```{r} +#| label: Verify that threads are passed +if (is.null(params$resources_threads)){ + stop('resource "threads" not passed to report') +} +``` + From 3c0a647a8dbd1c512c8099274678ba8f80461586 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Tue, 23 Jul 2024 13:49:09 +0200 Subject: [PATCH 16/18] Automatically pass resources if named resources_ If a quarto params named resources_ is defined the corresponding snakemake resource parameter is automatically passed. eg quarto param resources_mem_mb -> snakemake.resources.mem_mb will be passed. --- utils/quarto/meta.yaml | 20 +++++++----------- utils/quarto/wrapper.py | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 13 deletions(-) diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index c93f672c5e8..e5b638ec3a9 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -9,6 +9,9 @@ input: - The script must follow the following rules: - If parameters are used (extra arguments in `input`, `output`, `params`) they must be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr + - resources passed to the script must be defined in the quarto header as `resources_` followed by the resource name. + Eg `resources_mem` entry in the quarto header would cause the `sm.resources.mem` passed to the quarto script. + Threads will be passed if a parameter `resources_threads` is defined in the quarto header. - All dependencies used in the script must either be: - installed in the `renv` declared as `input.renv` (see `input.renv` documentation) - installed in the conda environment used to run this wrapper. If this is customized, use @@ -23,7 +26,7 @@ input: appropriate conda environment. Default: the project root directory - additional_inputs: > - Additional input files. These the paths will be passed as `params:` to the quarto script + Additional input files. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr output: - report: > @@ -32,23 +35,14 @@ output: PDF rendering is currently not supported due to the lack of support of tinytex in conda-forge. If not provided, the report will be rendered in a temporary directory and no output will be returned. - additional_outputs: > - Additional output files. These the paths will be passed as `params:` to the quarto script + Additional output files. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr params: - additional_params: > - Additional parameters to be passed to the quarto script. These the paths will be passed as `params:` to the quarto script + Additional parameters to be passed to the quarto script. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr - If wildcards/threads should be passed to the `quarto` script, use a function to pass it in params: - ``` - params: - project: lambda wc: wc.project - threads: lambda wc, threads: threads - mem: lambda wc, resources: resources.mem - ``` - will be passed to quarto render as `-P project=project -P threads=threads -P mem=mem` -notes: | This wrapper runs quarto to render markdown .qmd notebooks. - It supports r-package management via `conda` and `renv`: + The wrapper supports r-package management via `conda` and `renv`: - For `conda` overwrite the conda environment from the `conda:` directive of the rule with an environement with the r dependencies as well as `r-quarto` installed. - For `renv` restore an environment before and point the `input.renv` diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py index 06969b9167c..64a46a47c44 100644 --- a/utils/quarto/wrapper.py +++ b/utils/quarto/wrapper.py @@ -6,6 +6,7 @@ import tempfile from pathlib import Path import warnings +import yaml from snakemake.shell import shell @@ -25,6 +26,31 @@ def parse_renv(renv_path: Path) -> str: return str(renv_path.resolve()) +def parse_qmd_header(fn_script): + """Parse the yml header of the a + quarto markdown file + + Args: + fn_script (path): Path to the qmd script + + Raises: + ValueError: qmd has not valid header + + Returns: + dict: parsed header + """ + with open(fn_script, mode="r") as f: + first = f.readline() + if first != "---\n": + raise ValueError(".qmd file has no valid yaml header.") + line = f.readline() + yml_lines = [] + while line != "---\n": + yml_lines.append(line) + line = f.readline() + return yaml.safe_load("".join(yml_lines)) + + def add_parameter(name: str, value, param_list: list[str]) -> None: """Add a parameter to the parameter list in place @@ -59,6 +85,25 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: if name not in {"report"}: add_parameter(name, value, params) + +# Get the snakemake resources that correspond to +# Params in the qmd header that are prefixed with the resource prefix +# RESOURCE_PARAMS_PREFIX. +# eg resources_mem -> snakemake.resources.mem +RESOURCE_PARAMS_PREFIX = "resources_" +params_header = parse_qmd_header(script)["params"] +resources = {**snakemake.resources} +resources["threads"] = snakemake.threads +passed_resource_params = { + f"{RESOURCE_PARAMS_PREFIX}{k}": v + for k, v in resources.items() + if f"{RESOURCE_PARAMS_PREFIX}{k}" in params_header.keys() +} + +for name, value in passed_resource_params.items(): + add_parameter(name, value, params) + + # Resolve the logfile path and set the log_fmt_shell # This is required as we may change the working directory # to the renv folder for execution of quarto. From 7c76c195d95c336d6e8f63da5d1e4369661fcc73 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Mon, 29 Jul 2024 13:07:38 +0200 Subject: [PATCH 17/18] Add missing notes section Accidentally the header of the notes section in meta.yaml was removed --- utils/quarto/meta.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/utils/quarto/meta.yaml b/utils/quarto/meta.yaml index e5b638ec3a9..46f9634108b 100644 --- a/utils/quarto/meta.yaml +++ b/utils/quarto/meta.yaml @@ -4,7 +4,7 @@ url: https://github.com/quarto-dev/quarto-r authors: -Vito Zanotelli input: - - script: > + - script: | Quarto script to render (.qmd). - The script must follow the following rules: - If parameters are used (extra arguments in `input`, `output`, `params`) @@ -16,7 +16,7 @@ input: - installed in the `renv` declared as `input.renv` (see `input.renv` documentation) - installed in the conda environment used to run this wrapper. If this is customized, use the `conda: ` parameter to overwrite the default conda environment. - - renv: > + - renv: | Optional: Path a folder containing restored `renv` environment or a file within (eg `.Rprofile`, `renv.lock`). If this is used the `renv` must @@ -25,22 +25,23 @@ input: If this needs to be changed, change the `conda:` parameter to point to an appropriate conda environment. Default: the project root directory - - additional_inputs: > + - additional_inputs: | Additional input files. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr output: - - report: > + - report: | Optional: Path to the rendered report. The file extension will be used to determine the output format (eg `report.html`, `report.docx`). PDF rendering is currently not supported due to the lack of support of tinytex in conda-forge. If not provided, the report will be rendered in a temporary directory and no output will be returned. - - additional_outputs: > + - additional_outputs: | Additional output files. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr params: - - additional_params: > + - additional_params: | Additional parameters to be passed to the quarto script. These the paths will be passed as `-P :` to the quarto script and need to be defined in the quarto header as params: https://quarto.org/docs/computations/parameters.html#knitr +notes: | This wrapper runs quarto to render markdown .qmd notebooks. The wrapper supports r-package management via `conda` and `renv`: - For `conda` overwrite the conda environment from the `conda:` directive of the rule with an environement with From aff004e58d85c71b4d99b4650a93b410d63e1d68 Mon Sep 17 00:00:00 2001 From: Vito Zanotelli Date: Tue, 30 Jul 2024 08:41:53 +0200 Subject: [PATCH 18/18] Fix error quarto has no params --- utils/quarto/wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/quarto/wrapper.py b/utils/quarto/wrapper.py index 64a46a47c44..871a2a12dc6 100644 --- a/utils/quarto/wrapper.py +++ b/utils/quarto/wrapper.py @@ -91,7 +91,7 @@ def add_parameter(name: str, value, param_list: list[str]) -> None: # RESOURCE_PARAMS_PREFIX. # eg resources_mem -> snakemake.resources.mem RESOURCE_PARAMS_PREFIX = "resources_" -params_header = parse_qmd_header(script)["params"] +params_header = parse_qmd_header(script).get("params", {}) resources = {**snakemake.resources} resources["threads"] = snakemake.threads passed_resource_params = {