From fd98f956af55c70579a9b6a3f04f410131e13287 Mon Sep 17 00:00:00 2001 From: jvfe Date: Mon, 16 Dec 2024 11:04:21 -0300 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 769f8ddda11f5beded6baf83713b0cac79a2b333 Merge: 5ac5767a d44bcdf7 Author: Júlia Mir Pedrol Date: Mon Dec 16 14:23:39 2024 +0100 Merge pull request #3358 from mirpedrol/fix-pre-commit-template Fix pre commit template commit d44bcdf7e2065bd3ac281b27bcb33800e9af602d Author: mirpedrol Date: Mon Dec 16 13:06:36 2024 +0100 more prettier fixes commit 2c78c5ebc5fec773649e1f00ec5cc71f4c0f06a0 Author: mirpedrol Date: Mon Dec 16 12:28:59 2024 +0100 more template prittier fixing commit d19e3e071e7a792354221664f0b0b0ba4e409625 Author: mirpedrol Date: Mon Dec 16 12:11:49 2024 +0100 don't try running pre-commit if code-linters or github are not used in the template commit 13e553fca62efd06c810363625787396fe0e387c Author: mirpedrol Date: Mon Dec 16 12:08:20 2024 +0100 fix more prettier modifications form the template commit ac703bfed375f14c1c00798a9eba7260b0c57355 Author: mirpedrol Date: Mon Dec 16 11:58:43 2024 +0100 don't create rocrate file when we skip the feature commit 709e67ff4e395419b3de91dcf1b9b242f7689241 Author: mirpedrol Date: Mon Dec 16 11:46:35 2024 +0100 Remove Dumpler from ruamel yaml commit 0c4b0c0cf1f1cf110ab9a4b9695b098232e85d62 Merge: 2b2b4359 5ac5767a Author: Júlia Mir Pedrol Date: Mon Dec 16 11:35:31 2024 +0100 Merge branch 'dev' into fix-pre-commit-template commit 2b2b4359a9af852e8204d223659ae79b946a4864 Author: mirpedrol Date: Mon Dec 16 11:34:30 2024 +0100 prettify template and printing .nf-core.yml commit 5ac5767a4e901887d22c8cdaa090a19e282d7fc7 Merge: a8f63cd3 76ac617b Author: Matthias Zepper <6963520+MatthiasZepper@users.noreply.github.com> Date: Fri Dec 13 19:49:50 2024 +0100 Merge pull request #3351 from MatthiasZepper/no_env_in_download_action Replace Github environment usage in Download Action commit 76ac617b291caa37a53017c8758a0dc938f4c8b1 Author: Matthias Zepper Date: Fri Dec 13 14:11:56 2024 +0100 Remove endraw statement that 'nf-core pipelines' create does not like. commit 1fbd0119b561d32dfef7c6cbc618567ff8feb95c Author: nf-core-bot Date: Fri Dec 13 12:44:24 2024 +0000 [automated] Update CHANGELOG.md commit 9f61e8584ffc2f7a8417c226c04d8e15fc4dc2a4 Author: mirpedrol Date: Fri Dec 13 13:30:05 2024 +0100 run pre-commit from a git repo commit f6159c99490b7530bf3cbe081c78d71a828482a2 Author: mirpedrol Date: Fri Dec 13 13:29:17 2024 +0100 don't run prettier on ro-crate json file commit a8f63cd360b7ad18893c89140c01db765862c107 Merge: 6eaa9980 4db108c9 Author: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> Date: Fri Dec 13 17:58:57 2024 +0530 Merge pull request #3357 from nf-core/usage-typo-fix Add missing p commit 059473c2e138aecfb451f2f848265767761d798a Author: mirpedrol Date: Fri Dec 13 13:21:09 2024 +0100 fix pre-commit linting failures commit 4db108c90e3b3816f2237669505f628e7461ee9d Author: nf-core-bot Date: Fri Dec 13 12:08:36 2024 +0000 [automated] Update CHANGELOG.md commit edd29e0fc02d9d34528a48c244c2b18880acb94b Author: James A. Fellows Yates Date: Fri Dec 13 13:07:30 2024 +0100 Add missing p commit ac26924b6b5b849180eb4a6ca76ee9268805ef24 Merge: f02d6bb5 6eaa9980 Author: Matthias Zepper <6963520+MatthiasZepper@users.noreply.github.com> Date: Fri Dec 13 11:10:17 2024 +0100 Merge branch 'dev' into no_env_in_download_action commit 6eaa9980a4cdd0ca752c29ceca62240438482e4e Merge: 06980d49 a2c2339d Author: Júlia Mir Pedrol Date: Fri Dec 13 11:07:58 2024 +0100 Merge pull request #3356 from mirpedrol/fix-include-modules-config fix including modules.config commit f02d6bb5f96cee457a2fa2526808875349c6afb5 Author: Júlia Mir Pedrol Date: Thu Dec 12 11:14:52 2024 +0100 Update nf_core/pipeline-template/.github/workflows/awsfulltest.yml commit e32293d1508ae1590183a16b70e9aedbc964ee59 Author: mashehu Date: Tue Dec 10 16:01:04 2024 +0100 update changelog commit 4c32e4795214f847760a4e91482f682fa769dd5f Author: mashehu Date: Tue Dec 10 16:00:03 2024 +0100 fix if clause commit 4958cf0135b6257d14bd4ef7c84c0e21f12497dc Author: mashehu Date: Tue Dec 10 15:40:28 2024 +0100 Be more verbose in approval check action commit a8065da8a87bcc888530e03bb645d12909803f96 Author: Matthias Hörtenhuber Date: Thu Dec 12 10:59:54 2024 +0100 Revert "don't set up loggin level to error [no changelog]" commit 060eff51c3562fef14f188678f2a8eea2a8a05a7 Author: Matthias Zepper <6963520+MatthiasZepper@users.noreply.github.com> Date: Fri Dec 13 10:58:08 2024 +0100 Apply suggestions from code review Co-authored-by: Matthias Hörtenhuber commit a2c2339d4a2e89215b25e7f549721bc94c23f566 Author: mirpedrol Date: Fri Dec 13 10:47:18 2024 +0100 revert #3301 until we add linting from #2508 commit eed09ba43a0b85924bb3f8526f02dbdf12d85588 Author: nf-core-bot Date: Fri Dec 13 09:38:20 2024 +0000 [automated] Update CHANGELOG.md commit 4cf860785d5735d4cd5b026b93653e67533b88c9 Author: mirpedrol Date: Fri Dec 13 10:36:28 2024 +0100 fix including modules.config commit 06980d49cdb60cecff9315a998d7939c0ba30b21 Merge: aef5e166 8c5855f1 Author: Júlia Mir Pedrol Date: Fri Dec 13 09:38:59 2024 +0100 Merge pull request #3354 from mashehu/fix-ro-crate-in-bump-version Fix ro crate in bump version commit 8c5855f19a12bad41d8db15dc9238b6e89d634d2 Author: Júlia Mir Pedrol Date: Fri Dec 13 08:19:50 2024 +0000 get max of 100 branch names commit b1ebca0ab010a2af1448ccef1100e7c57b9ffb41 Merge: 307d0d4b aef5e166 Author: Júlia Mir Pedrol Date: Fri Dec 13 08:53:30 2024 +0100 Merge branch 'dev' into fix-ro-crate-in-bump-version commit aef5e1669abd3f06d266f58ec3411e5748d95784 Merge: 3c20e003 d65da79d Author: Júlia Mir Pedrol Date: Fri Dec 13 08:46:32 2024 +0100 Merge pull request #3353 from mashehu/bump-version-3_1_1dev bump version to 3.1.1dev commit 307d0d4b91729ba9d708f6fbd761414559c45e45 Author: mashehu Date: Thu Dec 12 16:09:53 2024 +0100 only bump ro-crate if it already exists commit d65da79dc24adb9c36f6d114eef9279f4c55b07c Author: mashehu Date: Thu Dec 12 15:04:39 2024 +0100 bump version to 3.1.1dev commit 62ebfc1af318b3bdc749fe75ad1bce407273ae54 Author: Matthias Zepper Date: Thu Dec 12 11:35:57 2024 +0100 Replace Github environment usage in Download Action. commit 3c20e003e87c46d451c66534d1f1baeb11efc675 Merge: f77737da c2a9dee1 Author: Júlia Mir Pedrol Date: Thu Dec 12 11:30:04 2024 +0100 Merge pull request #3338 from mashehu/more-verbose-awsfulltest-checks Be more verbose in approval check action commit c2a9dee17bc981f0b20bcea7dc167a620d409bb9 Author: Júlia Mir Pedrol Date: Thu Dec 12 11:14:52 2024 +0100 Update nf_core/pipeline-template/.github/workflows/awsfulltest.yml commit f77737da918a2bbc120690c27cdac5f66095fab8 Merge: d56b528f 8f00659c Author: Matthias Hörtenhuber Date: Thu Dec 12 11:12:01 2024 +0100 Merge pull request #3350 from nf-core/revert-3349-sync-debugging commit 8f00659ca4c54144eee4415a98dedad1eaf87d67 Author: Matthias Hörtenhuber Date: Thu Dec 12 10:59:54 2024 +0100 Revert "don't set up loggin level to error [no changelog]" commit d56b528f29351fb78b9ae65dc27fefd8df6cd816 Merge: 1af4c615 e92f327c Author: Júlia Mir Pedrol Date: Thu Dec 12 10:21:37 2024 +0100 Merge pull request #3349 from mirpedrol/sync-debugging don't set up loggin level to error [no changelog] commit e92f327cdc75e93253524b4e1c277e9ea8d91149 Author: mirpedrol Date: Thu Dec 12 10:00:43 2024 +0100 don't set up loggin level to error commit 1af4c6156e23c4ef3202aeaa1b5c45ec4addb7b8 Merge: 380be6c2 be38c157 Author: Matthias Hörtenhuber Date: Thu Dec 12 09:24:47 2024 +0100 Merge pull request #3347 from mashehu/specify-ref-in-sync-yml commit be38c157038786f6e1ae60ce82ffa666674d9d0e Author: mashehu Date: Wed Dec 11 20:06:58 2024 +0100 use same ref in checkout as triggered the workflow commit 380be6c2c20cd8306bd73089b3999bea21440e89 Author: mirpedrol Date: Wed Dec 11 16:10:05 2024 +0100 cleanup debugging echo commit 3858e38a5410684bfd58a1f6a27bcc4dc65fa81a Author: mirpedrol Date: Wed Dec 11 16:03:12 2024 +0100 try exiting pipeline directory before saving defaultBranch commit 1de1034c0888f515bc26c32559707b24e835890c Author: mirpedrol Date: Wed Dec 11 15:34:37 2024 +0100 echo message to sync GHA commit e8b6a9f5b52ec0f71f8c2204ca7a0f0428033c41 Merge: a4965f3e df5b3233 Author: Júlia Mir Pedrol Date: Wed Dec 11 14:58:34 2024 +0100 Merge pull request #3345 from mirpedrol/sync-default-branch add more debugging on sync GHA [no changelog] commit df5b3233a38b6732b9f45946fbe6493b8bc73151 Author: mirpedrol Date: Wed Dec 11 14:51:17 2024 +0100 add more debugging on sync GHA commit a4965f3e3892c0610c9553146bdd9a46fed60ef1 Merge: 06db03f3 6148983c Author: Júlia Mir Pedrol Date: Wed Dec 11 12:12:13 2024 +0100 Merge pull request #3342 from mirpedrol/sync-default-branch go back to original directory after configuring git defaultBranch [no changelog] commit 6148983c8469149cda6e834998cc01c78102f418 Author: mirpedrol Date: Wed Dec 11 11:44:22 2024 +0100 go back to original directory after configuring git defaultBranch commit 06db03f30e970733f25f215dfceb333d188bc609 Merge: 1a221067 379bad0e Author: Júlia Mir Pedrol Date: Wed Dec 11 11:13:59 2024 +0100 Merge pull request #3339 from mashehu/add-verbose-mode-to-sync Add verbose mode to sync action commit 379bad0e97a6a1ec407cd9a0705cf5be06557873 Author: Júlia Mir Pedrol Date: Wed Dec 11 10:03:37 2024 +0000 add input debug for workflow_dispatch sync action commit bb3a25294af0326cbbc81857f623bca50a12acc8 Author: Júlia Mir Pedrol Date: Wed Dec 11 10:42:54 2024 +0100 Apply suggestions from code review commit 5c8937e38b406f5748ebf3ed936de9b1ed0ddaa6 Author: mashehu Date: Tue Dec 10 17:19:32 2024 +0100 update changelog commit fa4e07424bf60a42559f4fa756495d7f326eea3c Author: mashehu Date: Tue Dec 10 17:17:02 2024 +0100 add verbose mode to sync action commit 174861324f70c243c71484d3216c5edfb8f78013 Author: mashehu Date: Tue Dec 10 16:01:04 2024 +0100 update changelog commit f7ced6bcd6e07baf89e6ee7f67d7f8f8c532ab0e Author: mashehu Date: Tue Dec 10 16:00:03 2024 +0100 fix if clause commit 0b7fe501992f288c8e5164f46ac8fd63d95ddb99 Author: mashehu Date: Tue Dec 10 15:40:28 2024 +0100 Be more verbose in approval check action commit 1a22106771d3c6b468e4d3cfb2046157188564cb Author: mashehu Date: Tue Dec 10 15:17:06 2024 +0100 fix Changelog commit 15b044d1b3a1a29b2406d42b5c791fd40e96ce9b Author: mashehu Date: Tue Dec 10 15:15:26 2024 +0100 change working dir when setting defaultBranch commit 7a69b8cec1115281c1cee10003203104d40e4cb1 Merge: 666fc9f5 0e7c8701 Author: mashehu Date: Tue Dec 10 14:44:40 2024 +0100 Merge branch 'dev' of github.com:nf-core/tools into fix-sync-grep commit 666fc9f522f8dc94d314758a36bbd260271df7b1 Author: mashehu Date: Tue Dec 10 14:44:12 2024 +0100 fix path for nextflow.config grep commit 0e7c87015e8e72fff540cc76809512a122644df9 Merge: a7917071 5ee2d52d Author: Matthias Hörtenhuber Date: Tue Dec 10 14:33:03 2024 +0100 Merge pull request #3337 from mashehu/fix-init-branch-in-sync-action set git defaultBranch to master in sync action commit 5ee2d52d5ef6a2ffe6e6970b65fbde7e7f7539c8 Author: mashehu Date: Tue Dec 10 14:30:14 2024 +0100 use nextflow.config to set defaultBranch commit 60ae1afaa7e568806602f579ee63577f5c0e4832 Author: mashehu Date: Tue Dec 10 13:26:07 2024 +0100 update changelog commit de00162797ddd833a592b918e6405d7f87d26f15 Author: mashehu Date: Tue Dec 10 13:20:46 2024 +0100 set git defaultBranch to master in sync action commit a7917071da2f4170204aa1962f799a8c9104b992 Merge: 05e7b950 47054ad1 Author: Matthias Hörtenhuber Date: Tue Dec 10 12:44:04 2024 +0100 Merge pull request #3335 from mashehu/set-default-branch-to-master set default_branch to master for now commit 47054ad1500238aa7561e7e6cee812d0d5d489c1 Merge: 7110fff5 05e7b950 Author: Matthias Hörtenhuber Date: Tue Dec 10 12:25:27 2024 +0100 Merge branch 'dev' into set-default-branch-to-master commit 7110fff5287cdeb2e5e769d7cf18bd725436f0ad Author: mashehu Date: Tue Dec 10 12:20:01 2024 +0100 update changelog commit e9cde5910a6ebd3e8bccef91a84ee9a47a56381a Author: mashehu Date: Tue Dec 10 12:17:54 2024 +0100 set default_branch to master for now commit 05e7b9503312b8987a7b178d38dd944a05d0d040 Merge: 55ca4d48 953055d3 Author: Matthias Hörtenhuber Date: Tue Dec 10 11:38:06 2024 +0100 Merge pull request #3334 from mashehu/update-crate-with-version-bump rocrate: Update crate with version bump and handle new contributor field commit 953055d337811a6c45db9f49b71008485e51e6b0 Author: mashehu Date: Tue Dec 10 11:22:01 2024 +0100 fix type error commit 8a78d4bcf489c1073ca4376a93c763e4c4927154 Author: Matthias Hörtenhuber Date: Tue Dec 10 10:51:44 2024 +0100 Update nf_core/pipelines/rocrate.py commit b976ec32a49f17e51784c425b2fc1a49be3a3307 Author: mashehu Date: Tue Dec 10 10:16:12 2024 +0100 update changelog commit 6ae3de544a77354c2276d4be16863b65ccaaa823 Author: mashehu Date: Tue Dec 10 10:14:47 2024 +0100 handle new author field commit 3e81adb62de4649c17a0c7233c8d3feec77e82e8 Author: mashehu Date: Tue Dec 10 10:13:51 2024 +0100 update version in ro crate on version bump commit 55ca4d4808b8527e15a11ee05cec2325d46b3a13 Merge: 5497cacb 0e62e6ed Author: Matthias Hörtenhuber Date: Mon Dec 9 18:57:09 2024 +0100 Merge pull request #3333 from mashehu/fix-duplicated-ro-crate-entries commit 0e62e6edcf77f46ff34d640b04019d781828ade2 Author: mashehu Date: Mon Dec 9 18:13:37 2024 +0100 update changelog commit 3c4fa811d521fe4090b2aca78154471d707ee58d Author: mashehu Date: Mon Dec 9 18:12:08 2024 +0100 rocrate: remove duplicated entries for name and version commit 5497cacb1e0ddcf9a7a73b7cb92276904a7abe4b Merge: 4ea867a4 045aaec4 Author: Júlia Mir Pedrol Date: Mon Dec 9 17:30:06 2024 +0100 Merge pull request #3332 from mashehu/fix-gitpod-yml Don't break gitpod.yml with template string commit 045aaec42944e2ef7dfd2d1d6e2fcd1a6775d320 Author: mashehu Date: Mon Dec 9 17:11:04 2024 +0100 fix template string commit 5b1cf24f7fc9548928221f914253570c7238b63d Author: Matthias Hörtenhuber Date: Mon Dec 9 17:09:32 2024 +0100 Update nf_core/pipeline-template/.gitpod.yml Co-authored-by: Júlia Mir Pedrol commit 15880be40d065d4d89dd2c2c65513713a029289b Author: mashehu Date: Mon Dec 9 16:54:17 2024 +0100 make prettier happy commit 337143daba96d73a78ff2c324c2ff38381f60e4f Author: mashehu Date: Mon Dec 9 16:43:57 2024 +0100 update changelog commit 5bc9952308c1e99ec24ee92f4b29cec52399fca7 Merge: 03854903 77ccc6a3 Author: mashehu Date: Mon Dec 9 16:41:43 2024 +0100 Merge branch 'fix-gitpod-yml' of github.com:mashehu/tools into fix-gitpod-yml commit 038549034dadeed8835719b893429cd8b29a80a3 Author: mashehu Date: Mon Dec 9 16:41:31 2024 +0100 don't break gitpod.yml with template string commit 4ea867a4e7732c72fb6f5cff6f4ec3fd62ecce5a Merge: 3f85556c 8c9888bf Author: Matthias Hörtenhuber Date: Mon Dec 9 16:09:09 2024 +0100 Merge pull request #3330 from mashehu/skip-GRCh37 Template: Remove mention of GRCh37 if igenomes is skipped commit 3f85556c65a8122b40a5acc3043bc1a255f89671 Merge: 7586248b a59e929b Author: Matthias Hörtenhuber Date: Mon Dec 9 16:02:06 2024 +0100 Merge pull request #3331 from mirpedrol/revert-textual-dev-1.7.0 Revert textual dev 1.7.0 [no changelog] commit 8c9888bf893ac17fa943c2998a09a7e24c619d56 Merge: 1da1fc60 7586248b Author: mashehu Date: Mon Dec 9 15:51:16 2024 +0100 Merge branch 'dev' of github.com:nf-core/tools into skip-GRCh37 # Conflicts: # nf_core/pipeline-template/.gitpod.yml commit a59e929bd677e4437ba59fcf8ac3d921b0570fd2 Author: mirpedrol Date: Mon Dec 9 15:44:24 2024 +0100 revert updating textual-dev to 1.7.0 commit 1da1fc600271fccdccc41b4c1cb8f5724a85c148 Author: mashehu Date: Mon Dec 9 15:27:29 2024 +0100 update changelog commit e073622e8bdfb1879eb38fc981cf931152322aac Author: mashehu Date: Mon Dec 9 15:23:56 2024 +0100 add missing closing tag commit 76ac145edee3cc5ee8e60c3959dba41e296d66ab Author: mashehu Date: Mon Dec 9 15:23:20 2024 +0100 remove mention of GRCh37 from template if igenomes is skipped closes #3322 commit 7586248b02c7f03fb510ff962b0074bd98404393 Merge: edbeee36 afdb0128 Author: Matthias Hörtenhuber Date: Mon Dec 9 13:52:54 2024 +0100 Merge pull request #3329 from mashehu/bump-version-3_1_0 Bump version 3.1.0 commit afdb012820ffbb07c037d36da0233e30502624a5 Author: Júlia Mir Pedrol Date: Mon Dec 9 12:29:16 2024 +0000 add highlights and version updates sections to changelog commit ae1066c79dccda7068b957360234feecdfe0d5c4 Author: mashehu Date: Mon Dec 9 13:10:57 2024 +0100 bump to 3.1.0 commit edbeee366f0407cb43b5580d86af04a3bce26f4b Merge: 7e30b29f ee12866a Author: Júlia Mir Pedrol Date: Mon Dec 9 12:58:26 2024 +0100 Merge pull request #3328 from mirpedrol/update-template-components Update template components commit 7e30b29fa51ff4329caa754ff59ea8a608d4d657 Merge: 99dba72b 4ab2637d Author: Júlia Mir Pedrol Date: Mon Dec 9 12:51:02 2024 +0100 Merge pull request #3308 from nf-core/renovate/textual-dev-1.x Update dependency textual-dev to v1.7.0 commit ee12866a96d2b4038be1765034f0d7511cb25be0 Author: nf-core-bot Date: Mon Dec 9 11:45:14 2024 +0000 [automated] Update CHANGELOG.md commit f2090961118d94c5be201b9e6bbbf03899ba920f Author: mirpedrol Date: Mon Dec 9 12:43:50 2024 +0100 fix jinja template missing endif commit 69f00bc5003830677c42bceab34a60aec56e7365 Author: mirpedrol Date: Mon Dec 9 12:40:42 2024 +0100 update utils_nfcore_pipeline swf commit 4ab2637dd0dad73ba4d3574acd0e3fb9dc0aca0e Merge: c5ffcf87 99dba72b Author: Júlia Mir Pedrol Date: Mon Dec 9 12:34:23 2024 +0100 Merge branch 'dev' into renovate/textual-dev-1.x commit 99dba72b19b5ee18a135c810c7beb66e54dfc351 Merge: 98285e34 e5f0bd35 Author: Júlia Mir Pedrol Date: Mon Dec 9 12:31:05 2024 +0100 Merge pull request #3292 from nf-core/vs-code-tests build: Setup VS Code tests commit e5f0bd35c18d94f05f28327af37bb77206e32c93 Merge: a39ed597 98285e34 Author: Júlia Mir Pedrol Date: Mon Dec 9 12:04:05 2024 +0100 Merge branch 'dev' into vs-code-tests commit 98285e3480cd68b5d9309bdcbd3ba4a1bb8950c6 Merge: 582774ba 7a03d907 Author: Matthias Hörtenhuber Date: Mon Dec 9 12:03:18 2024 +0100 Merge pull request #3323 from mashehu/fix-api-doc-headers fix headers in api docs commit 582774baedefe239f5d35ea6bde8af4e3aa8de72 Merge: b14b5048 9f4036c5 Author: Júlia Mir Pedrol Date: Mon Dec 9 12:03:04 2024 +0100 Merge pull request #3304 from nf-core/remove-channel-operations-from-oncomplete Remove toList() channel operation from inside onComplete block commit 9f4036c5125ea364e06a90cef4eb0c69e0eec113 Merge: f22d7d9e b14b5048 Author: Júlia Mir Pedrol Date: Mon Dec 9 11:06:25 2024 +0100 Merge branch 'dev' into remove-channel-operations-from-oncomplete commit 7a03d907f6cdf8d75344edbbf2a141854346da11 Author: nf-core-bot Date: Mon Dec 9 09:47:45 2024 +0000 [automated] Fix code linting commit efdced268bddc3e217045c978d42efaf6e640d0d Merge: f54e1234 b14b5048 Author: Matthias Hörtenhuber Date: Mon Dec 9 10:44:03 2024 +0100 Merge branch 'dev' into fix-api-doc-headers commit b14b50487d16ec2a21dd92a2548b7890b26743b8 Merge: 0450503e 9c0f2acb Author: Phil Ewels Date: Sat Dec 7 08:10:25 2024 +0100 Merge pull request #3326 from nf-core/modules-outside-nf-core-too commit 0450503e049d884ac4242a598ee46342a359c93c Merge: b2132cf1 cc38f8d7 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Sat Dec 7 10:47:24 2024 +1300 Merge pull request #3317 from lmReef/fix-linting-error Fix meta_yml linting error commit cc38f8d75b664141596be4e7289c94bdaf1c8119 Merge: 3cc7646c b2132cf1 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Sat Dec 7 10:27:12 2024 +1300 Merge branch 'dev' into fix-linting-error commit b2132cf116e26925668c44d02daf5d44cb6f7395 Merge: 0ba1c700 af05e4ac Author: Matthias Hörtenhuber Date: Fri Dec 6 22:24:03 2024 +0100 Merge pull request #3321 from lmReef/fix-module-section-regex commit af05e4ac3aff1b8ae3b38485c05fac66fe49c1ce Merge: faded6a9 0ba1c700 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Sat Dec 7 10:04:17 2024 +1300 Merge branch 'dev' into fix-module-section-regex commit 3cc7646ce4f2ac3a5e2b3eeb7b4ad681cbb88aa8 Merge: c5dc6ac7 0ba1c700 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Sat Dec 7 10:04:15 2024 +1300 Merge branch 'dev' into fix-linting-error commit 9c0f2acb3ed544130b2ab71f12f64ee1eeb93fcb Merge: ba447fbf 0ba1c700 Author: Phil Ewels Date: Fri Dec 6 19:25:24 2024 +0100 Merge branch 'dev' into modules-outside-nf-core-too commit 0ba1c7007490f10a0f985a5d70fef474b58f0cac Author: nf-core-bot Date: Fri Dec 6 13:55:42 2024 +0000 [automated] Update CHANGELOG.md commit 6a59a9749450bcf796aab68506302145e5f93efd Author: Mahesh Binzer-Panchal Date: Fri Dec 6 13:50:30 2024 +0000 Update gitpod vscode extensions to use nf-core extension pack commit ba447fbf7027312d7562ac533b9ca26ff68574fe Author: nf-core-bot Date: Thu Dec 5 22:57:35 2024 +0000 [automated] Update CHANGELOG.md commit da16adb69b352d9a2e5120137a5c2ac0be88264a Author: Phil Ewels Date: Thu Dec 5 23:56:27 2024 +0100 Make prompt less nf-core specific commit c5dc6ac70825396bc7b54232c2115db25cd76efc Merge: c3fd9bb0 978f8656 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Fri Dec 6 08:45:34 2024 +1300 Merge branch 'dev' into fix-linting-error commit faded6a9f52f7b8a1e331388dde35a87239a3d5b Merge: c22c571c 978f8656 Author: lmReef <60915116+lmReef@users.noreply.github.com> Date: Fri Dec 6 08:45:21 2024 +1300 Merge branch 'dev' into fix-module-section-regex commit 978f86564b74fa924dc9a576b2158c8b503313ab Merge: e8510ccf c03f2128 Author: Matthias Hörtenhuber Date: Thu Dec 5 19:49:45 2024 +0100 Merge pull request #3325 from nf-core/renovate/astral-sh-ruff-pre-commit-0.x commit c03f21288a0ff05dc42f2b5dddf135531564fbed Author: nf-core-bot Date: Thu Dec 5 16:52:26 2024 +0000 [automated] Update CHANGELOG.md commit 2c5932e66e2cdbf85728fb0ec03c695e5aebdb8a Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu Dec 5 16:49:54 2024 +0000 Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.2 commit f54e1234e9451afbafecb26f124261ba8bc3977b Author: nf-core-bot Date: Thu Dec 5 16:04:21 2024 +0000 [automated] Update CHANGELOG.md commit e8510ccf4438d7c1e01045a3b090d7f7ebc65703 Merge: f4b5b5d0 ce866c62 Author: Júlia Mir Pedrol Date: Thu Dec 5 16:47:32 2024 +0100 Merge pull request #3142 from mashehu/master-to-main Allow `main` as default channel commit f4b5b5d00764ba05b07f9c2cca894b5140b67264 Merge: a9d97e4f c23af55f Author: Matthias Hörtenhuber Date: Thu Dec 5 16:36:36 2024 +0100 Merge pull request #3298 from nf-core/subworkflow-messages Improve subworkflow nf-test migration warning commit 6ddfe4d35b4a159dd5f18a12c77c6761ec66068f Author: mashehu Date: Thu Dec 5 16:30:44 2024 +0100 fix headers commit c23af55faa65b9f4bc6735917bdcbb77acdc500e Author: nf-core-bot Date: Thu Dec 5 15:19:54 2024 +0000 [automated] Update CHANGELOG.md commit a9d97e4f296551fd0c7b9e071a0990007b3b3770 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu Dec 5 12:16:57 2024 +0000 Update python:3.12-slim Docker digest to 2b00791 (#3319) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit ce866c62c141ce1e0126dad9942f879e8bea3f89 Author: Júlia Mir Pedrol Date: Thu Dec 5 11:55:09 2024 +0100 Remove not needed setup-java step commit c22c571cff747b1fb47ae11d3dc1fa76e14a9a2f Author: lmReef Date: Thu Dec 5 10:14:01 2024 +1300 Revert "[automated] Update CHANGELOG.md" This reverts commit 355dff2c8e8fa28b628459bab65efeadf3793dfc. commit 9996df9e061a7512f6cce1d34fc0e8f7a937df95 Author: lmReef Date: Thu Dec 5 10:11:58 2024 +1300 update changelog commit 355dff2c8e8fa28b628459bab65efeadf3793dfc Author: nf-core-bot Date: Wed Dec 4 21:10:36 2024 +0000 [automated] Update CHANGELOG.md commit 57a92a0eff27c3570ae2cfcf73a765a66ed3c541 Author: lmReef Date: Thu Dec 5 09:34:08 2024 +1300 fix: module section linter regex commit c3fd9bb084c86e1204e9d4cbeebef413444b1834 Author: lmReef Date: Thu Dec 5 08:59:07 2024 +1300 fix: add explicit str type to self.process_name commit f22d7d9e03f33c078967e38bc7174e6a5de6547c Author: Rob Syme Date: Wed Dec 4 08:09:57 2024 -0500 Revert changes to nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf commit b94435b92891b2cee0a78c47890b1d7349d30376 Author: Júlia Mir Pedrol Date: Wed Dec 4 09:48:13 2024 +0000 remove too many raw/endraw in branch.yml commit 4a8e97631b6164b92f039de74e462cd9b9dd94ee Author: lmReef Date: Wed Dec 4 10:41:19 2024 +1300 update changelog entry with link commit d3d9c72d7a20b617e417a8e0ba22ad9b29944d07 Author: lmReef Date: Wed Dec 4 10:29:10 2024 +1300 update changelog commit b04351db539fc3962b816595ee7ab9eae3a83bd3 Author: lmReef Date: Wed Dec 4 09:54:53 2024 +1300 fix: python linting warn commit dc9c3b1763d3f41ae42a4c97a405ba9bfad61878 Author: lmReef Date: Wed Dec 4 09:43:11 2024 +1300 fix: linting error in meta_yml where module.process_name is always "" commit 229a2329dfefc5981897006c546a00d61da587da Author: mashehu Date: Tue Dec 3 18:14:33 2024 +0100 disambiguate in more places commit 2e4a8ede4b1f7af1efc003cd0ce8524b002e8612 Author: mashehu Date: Tue Dec 3 16:50:53 2024 +0100 use contect to figure out if it master or main Co-authored-by: @mirpredrol commit 9c43f15ea589c17374b593dabcf6dea621c07e64 Author: mashehu Date: Tue Dec 3 15:36:20 2024 +0100 avoid confusion by separating the string commit 14480d280739292c69c32bc2dd0f1f0127abe136 Author: mashehu Date: Tue Dec 3 15:26:31 2024 +0100 use java v17 commit 1857ebf51658a0100d70fa324303b6e4fa3adb12 Author: mashehu Date: Tue Dec 3 14:46:55 2024 +0100 add missing setup-java action commit 8bc1a307d1ef53a9311f0ce5e44064217f2e1006 Author: mashehu Date: Tue Dec 3 14:43:11 2024 +0100 nope, setup-java it is commit a604cb5595e9f93059d58ba1e6a9d613430803b6 Author: mashehu Date: Tue Dec 3 14:37:17 2024 +0100 set the variable manually commit 2475ad1604a73aaff7901ce8edb99312cd408298 Merge: 4b2338ff a7351a24 Author: Júlia Mir Pedrol Date: Tue Dec 3 13:35:46 2024 +0000 Merge branch 'dev' of https://github.com/nf-core/tools into remove-channel-operations-from-oncomplete commit 4b2338ff161a1ddea799c8ab5270e1cefe0f7da0 Author: Júlia Mir Pedrol Date: Tue Dec 3 13:32:17 2024 +0000 update modules and subworkflows commit 00b8ae0da46a7562be763c9efa6b82c696a362ba Author: mashehu Date: Tue Dec 3 14:18:06 2024 +0100 pin java version 21 in CI commit e9ed94ec0f8ece41b406e2f15cd1d7089bc54621 Author: mashehu Date: Tue Dec 3 14:08:04 2024 +0100 set defaultBranch in nextflow config to allow `main` commit 831548e31b0771eb2e1e0eaade2a6a46562ad554 Merge: 73957fd1 a7351a24 Author: Matthias Hörtenhuber Date: Tue Dec 3 13:55:21 2024 +0100 Merge branch 'dev' into master-to-main commit 73957fd113da99ec85f7c54dfe71a93007308b54 Merge: bd9608d6 41b4516e Author: mashehu Date: Tue Dec 3 13:54:11 2024 +0100 Merge branch 'main' of github.com:nf-core/tools into master-to-main # Conflicts: # .github/RELEASE_CHECKLIST.md # .github/workflows/branch.yml # .github/workflows/pytest.yml # nf_core/pipeline-template/README.md # nf_core/pipeline-template/assets/schema_input.json # nf_core/pipeline-template/nextflow_schema.json commit bd9608d688f722d17398d8a7fe1d5dfeaeed02be Author: Matthias Hörtenhuber Date: Tue Dec 3 13:38:33 2024 +0100 Update nf_core/components/create.py commit a39ed5974bcc4ee454023990d3908d99c19b5ec9 Merge: 35eb958d a7351a24 Author: Júlia Mir Pedrol Date: Tue Dec 3 13:27:47 2024 +0100 Merge branch 'dev' into vs-code-tests commit abb0fa2f4bee2123559583f27c2855c52588d3be Author: Robert Syme Date: Fri Nov 29 14:34:37 2024 -0500 Remove toList() channel operation from inside onComplete block This PR resolves an important bug in the nf-core template, whereby all workflows will hang if the --email parameter is supplied. The onComplete block will hang if there are any (queue) channel operations inside the block. All values in the onComplete block must be resolved to single values or value channels _before_ the onComplete block starts. The async channels are not available inside onComplete, so calling the toList() operation will hang forever as the async queue channel will never be completed. commit c5ffcf87e6c742fb224e79b116c8d318b448244e Author: nf-core-bot Date: Sun Dec 1 02:09:38 2024 +0000 [automated] Update CHANGELOG.md commit 456aa055b48af339a04ce7170d7aad3d5732b940 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 1 02:08:49 2024 +0000 Update dependency textual-dev to v1.7.0 commit 35eb958d39fe52b938e535c100afcb6bb19d1549 Author: Edmund Miller Date: Tue Nov 26 02:17:48 2024 +0000 Add Python terminal env settings commit 805620b5dee7185dd9e5e4f3a409208fdf66c03a Author: Edmund Miller Date: Mon Nov 25 11:09:22 2024 -0600 fix(#3297): Update warning message for pytest-workflow commit 3456346eea3f6104cf0de7e38ccc8543a44d3c3f Author: nf-core-bot Date: Thu Nov 21 17:29:49 2024 +0000 [automated] Update CHANGELOG.md commit dd477ab82f7a162e1515bc0f43a72af7147d3618 Author: Edmund Miller Date: Wed Nov 20 22:50:15 2024 -0600 build: Setup VS Code tests commit fa2750a6c3fbc2ce3ccaf1f97e862fbbb301940e Author: mashehu Date: Tue Aug 27 15:18:27 2024 +0200 use format instead of f-string commit 19ec18810aafff259a85bb848520e9671c919672 Author: mashehu Date: Tue Aug 27 10:30:07 2024 +0200 revert to format commit 20545509ff899d82683baca5a7395a84febb9c73 Author: mashehu Date: Tue Aug 27 10:07:47 2024 +0200 fix quotes commit 9d2a3abf8af09b172b5065e40d7618f0dbfbecca Author: mashehu Date: Tue Aug 27 09:12:38 2024 +0200 fix order in lint commit ed0fb1b4bb0b7c21ea61d6ed84197b692b02905a Author: mashehu Date: Tue Aug 27 09:08:51 2024 +0200 set default value for default branch commit da915195f6450f6870eec2b2dbccf1dbd7f2206d Author: mashehu Date: Tue Aug 27 09:00:05 2024 +0200 fix schema check commit 5b3dabd588f84f2e2dc111aa639e07a3ebfd3c87 Author: mashehu Date: Tue Aug 27 08:47:44 2024 +0200 fix order of initialization commit 889e59e15f2d77377ebfd7912ee5205bd853a403 Author: mashehu Date: Tue Aug 27 08:41:53 2024 +0200 handle missing self.default_branch commit 6fc6da2514c0aa73a6c971f639e52bd4d44590cf Author: mashehu Date: Tue Aug 27 07:30:15 2024 +0200 change pipeline template and tooling to allow `main` as default branch commit 77ccc6a3608b4656d157cf729799636b676d201b Author: mashehu Date: Wed Dec 20 15:51:04 2023 +0100 set gitpod.yml docker image to latest --- .github/actions/create-lint-wf/action.yml | 1 - .github/workflows/create-lint-wf.yml | 4 +- .../create-test-lint-wf-template.yml | 1 + .github/workflows/create-test-wf.yml | 4 +- .github/workflows/sync.yml | 23 +++++- .gitpod.yml | 9 +-- .pre-commit-config.yaml | 2 +- .vscode/settings.json | 9 +++ CHANGELOG.md | 69 ++++++++++++++---- Dockerfile | 2 +- docs/api/_src/api/pipelines/bump_version.md | 2 +- docs/api/_src/api/pipelines/create.md | 2 +- docs/api/_src/api/pipelines/download.md | 2 +- docs/api/_src/api/pipelines/launch.md | 2 +- docs/api/_src/api/pipelines/lint.md | 2 +- docs/api/_src/api/pipelines/list.md | 2 +- docs/api/_src/api/pipelines/params-file.md | 2 +- docs/api/_src/api/pipelines/schema.md | 2 +- docs/api/_src/api/pipelines/sync.md | 2 +- docs/api/_src/api/pipelines/utils.md | 2 +- nf_core/__main__.py | 4 +- nf_core/components/components_utils.py | 4 +- nf_core/components/nfcore_component.py | 10 ++- nf_core/modules/lint/main_nf.py | 11 ++- .../pipeline-template/.github/CONTRIBUTING.md | 4 +- .../.github/ISSUE_TEMPLATE/bug_report.yml | 1 - .../.github/PULL_REQUEST_TEMPLATE.md | 4 +- .../.github/workflows/awsfulltest.yml | 18 ++++- .../.github/workflows/branch.yml | 18 +++-- .../.github/workflows/download_pipeline.yml | 49 ++++++++----- nf_core/pipeline-template/.gitpod.yml | 14 +--- nf_core/pipeline-template/.prettierignore | 3 + nf_core/pipeline-template/CITATIONS.md | 2 +- nf_core/pipeline-template/README.md | 13 ++-- .../assets/schema_input.json | 2 +- nf_core/pipeline-template/docs/output.md | 11 ++- nf_core/pipeline-template/docs/usage.md | 8 +- nf_core/pipeline-template/modules.json | 2 +- nf_core/pipeline-template/nextflow.config | 15 ++-- .../pipeline-template/nextflow_schema.json | 8 +- .../utils_nfcore_pipeline_pipeline/main.nf | 6 +- .../nf-core/utils_nfcore_pipeline/main.nf | 42 +++++------ .../tests/main.function.nf.test | 44 +++++++++++ nf_core/pipelines/bump_version.py | 5 ++ nf_core/pipelines/create/create.py | 73 ++++++++++++------- .../pipelines/create/template_features.yml | 6 ++ nf_core/pipelines/download.py | 2 +- nf_core/pipelines/lint/actions_awsfulltest.py | 2 +- nf_core/pipelines/lint/version_consistency.py | 2 +- nf_core/pipelines/lint_utils.py | 2 +- nf_core/pipelines/rocrate.py | 45 +++++++++++- nf_core/pipelines/schema.py | 8 +- .../subworkflows/lint/subworkflow_tests.py | 2 +- nf_core/synced_repo.py | 7 +- nf_core/utils.py | 2 +- requirements-dev.txt | 2 +- setup.py | 2 +- tests/pipelines/lint/test_actions_awstest.py | 2 +- tests/pipelines/test_lint.py | 2 +- tests/pipelines/test_rocrate.py | 35 +++++++++ tests/pipelines/test_sync.py | 8 +- tests/utils.py | 4 +- 62 files changed, 444 insertions(+), 204 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.github/actions/create-lint-wf/action.yml b/.github/actions/create-lint-wf/action.yml index 3ef0760513..3ffd960d23 100644 --- a/.github/actions/create-lint-wf/action.yml +++ b/.github/actions/create-lint-wf/action.yml @@ -15,7 +15,6 @@ runs: cd create-lint-wf export NXF_WORK=$(pwd) - # Set up Nextflow - name: Install Nextflow uses: nf-core/setup-nextflow@v2 with: diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 37ab71bc3b..fa6c38ef07 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -27,14 +27,12 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - NXF_ANSI_LOG: false - jobs: MakeTestWorkflow: runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }} env: NXF_ANSI_LOG: false + strategy: matrix: NXF_VER: diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index fffa9ffe7a..cabd4b9abe 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -51,6 +51,7 @@ jobs: needs: prepare-matrix env: NXF_ANSI_LOG: false + strategy: matrix: TEMPLATE: ${{ fromJson(needs.prepare-matrix.outputs.all_features) }} diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index 93581b9153..53f84b72c4 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -27,15 +27,13 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - NXF_ANSI_LOG: false - jobs: RunTestWorkflow: # use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }} env: NXF_ANSI_LOG: false + strategy: matrix: NXF_VER: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 625f00d247..7061294783 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -23,6 +23,10 @@ on: description: "Pipeline to sync" type: string default: "all" + debug: + description: "Enable debug/verbose mode (true or false)" + type: boolean + default: false # Cancel if a newer run is started concurrency: @@ -62,6 +66,8 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 name: Check out nf-core/tools + with: + ref: ${{ github.ref_name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 name: Check out nf-core/${{ matrix.pipeline }} @@ -87,6 +93,19 @@ jobs: with: version: "latest-everything" + - name: Set Git default branch from nextflow.config and set git default branch to that or "master" + + run: | + pushd nf-core/${{ matrix.pipeline }} + defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2) + if [ -z "$defaultBranch" ]; then + defaultBranch="master" + fi + popd + echo "Default branch: $defaultBranch" + echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT + git config --global init.defaultBranch $defaultBranch + - name: Run synchronisation if: github.repository == 'nf-core/tools' env: @@ -94,7 +113,9 @@ jobs: run: | git config --global user.email "core@nf-co.re" git config --global user.name "nf-core-bot" - nf-core --log-file sync_log_${{ matrix.pipeline }}.txt pipelines sync -d nf-core/${{ matrix.pipeline }} \ + nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \ + ${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \ + pipelines sync -d nf-core/${{ matrix.pipeline }} \ --from-branch dev \ --pull-request \ --username nf-core-bot \ diff --git a/.gitpod.yml b/.gitpod.yml index efe193f35f..d5948695bf 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -9,11 +9,4 @@ tasks: vscode: extensions: - - esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code - - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files - - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar - - mechatroner.rainbow-csv # Highlight columns in csv files in different colors - - nextflow.nextflow # Nextflow syntax highlighting - - oderwat.indent-rainbow # Highlight indentation level - - streetsidesoftware.code-spell-checker # Spelling checker for source code - - charliermarsh.ruff # Code linter Ruff + - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1494f58182..68a6fa3ed7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.1 + rev: v0.8.2 hooks: - id: ruff # linter args: [--fix, --exit-non-zero-on-fix] # sort imports and fix diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..5ffdff086c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestArgs": ["tests", "-v", "--tb=short"], + "python.testing.autoTestDiscoverOnSaveEnabled": true, + "python.terminal.activateEnvInCurrentTerminal": true, + "python.terminal.shellIntegration.enabled": true +} diff --git a/CHANGELOG.md b/CHANGELOG.md index da5f72c357..603dd664c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,42 @@ # nf-core/tools: Changelog -## v3.0.3dev +## v3.1.1dev + +### Template + +- Use outputs instead of the environment to pass around values between steps in the Download Test Action ([#3351](https://github.com/nf-core/tools/pull/3351)) +- Fix pre commit template ([#3358](https://github.com/nf-core/tools/pull/3358)) + +### Download + +### Linting + +### Modules + +- fix including modules.config ([#3356](https://github.com/nf-core/tools/pull/3356)) + +### Subworkflows + +### General + +- Add missing p ([#3357](https://github.com/nf-core/tools/pull/3357)) + +### Version updates + +## [v3.1.0 - Brass Boxfish](https://github.com/nf-core/tools/releases/tag/3.1.0) - [2024-12-09] + +**Highlights** + +- We added the new `contributors` field to the pipeline template `manifest`. +- The `nf-core pipelines download` command supports ORAS container URIs. +- New command `nf-core subworkflows patch`. ### Template - Keep pipeline name in version.yml file ([#3223](https://github.com/nf-core/tools/pull/3223)) - Fix Manifest DOI text ([#3224](https://github.com/nf-core/tools/pull/3224)) - Do not assume pipeline name is url ([#3225](https://github.com/nf-core/tools/pull/3225)) -- fix workflow_dispatch trigger and parse more review comments in awsfulltest ([#3235](https://github.com/nf-core/tools/pull/3235)) +- fix `workflow_dispatch` trigger and parse more review comments in awsfulltest ([#3235](https://github.com/nf-core/tools/pull/3235)) - Add resource limits to Gitpod profile([#3255](https://github.com/nf-core/tools/pull/3255)) - Fix a typo ([#3268](https://github.com/nf-core/tools/pull/3268)) - Remove `def` from `nextflow.config` and add `trace_report_suffix` param ([#3296](https://github.com/nf-core/tools/pull/3296)) @@ -15,16 +44,21 @@ - Use `params.monochrome_logs` in the template and update nf-core components ([#3310](https://github.com/nf-core/tools/pull/3310)) - Fix some typos and improve writing in `usage.md` and `CONTRIBUTING.md` ([#3302](https://github.com/nf-core/tools/pull/3302)) - Add `manifest.contributors` to `nextflow.config` ([#3311](https://github.com/nf-core/tools/pull/3311)) +- Update template components ([#3328](https://github.com/nf-core/tools/pull/3328)) +- Template: Remove mention of GRCh37 if igenomes is skipped ([#3330](https://github.com/nf-core/tools/pull/3330)) +- Be more verbose in approval check action ([#3338](https://github.com/nf-core/tools/pull/3338)) ### Download -- First steps towards fixing [#3179](https://github.com/nf-core/tools/issues/3179): Modify `prioritize_direct_download()` to retain Seqera Singularity https:// Container URIs and hardcode Seqera Containers into `gather_registries()` ([#3244](https://github.com/nf-core/tools/pull/3244)). +- First steps towards fixing [#3179](https://github.com/nf-core/tools/issues/3179): Modify `prioritize_direct_download()` to retain Seqera Singularity `https://` Container URIs and hardcode Seqera Containers into `gather_registries()` ([#3244](https://github.com/nf-core/tools/pull/3244)). - Further steps towards fixing [#3179](https://github.com/nf-core/tools/issues/3179): Enable limited support for `oras://` container paths (_only absolute URIs, no flexible registries like with Docker_) and prevent unnecessary image downloads for Seqera Container modules with `reconcile_seqera_container_uris()` ([#3293](https://github.com/nf-core/tools/pull/3293)). - Update dawidd6/action-download-artifact action to v7 ([#3306](https://github.com/nf-core/tools/pull/3306)) ### Linting - allow mixed `str` and `dict` entries in lint config ([#3228](https://github.com/nf-core/tools/pull/3228)) +- fix `meta_yml` linting test failing due to `module.process_name` always being `""` ([#3317](https://github.com/nf-core/tools/pull/3317)) +- fix module section regex matching wrong things ([#3321](https://github.com/nf-core/tools/pull/3321)) ### Modules @@ -33,29 +67,38 @@ ### Subworkflows - Add `nf-core subworkflows patch` command ([#2861](https://github.com/nf-core/tools/pull/2861)) +- Improve subworkflow nf-test migration warning ([#3298](https://github.com/nf-core/tools/pull/3298)) ### General -- Include .nf-core.yml in `nf-core pipelines bump-version` ([#3220](https://github.com/nf-core/tools/pull/3220)) +- Include `.nf-core.yml` in `nf-core pipelines bump-version` ([#3220](https://github.com/nf-core/tools/pull/3220)) - create: add shortcut to toggle all switches ([#3226](https://github.com/nf-core/tools/pull/3226)) - Remove unrelated values when saving `.nf-core` file ([#3227](https://github.com/nf-core/tools/pull/3227)) -- chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v1.12.0 ([#3230](https://github.com/nf-core/tools/pull/3230)) -- chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.7.0 ([#3229](https://github.com/nf-core/tools/pull/3229)) -- Update python:3.12-slim Docker digest to 032c526 ([#3232](https://github.com/nf-core/tools/pull/3232)) - use correct `--profile` options for `nf-core subworkflows test` ([#3233](https://github.com/nf-core/tools/pull/3233)) - Update GitHub Actions ([#3237](https://github.com/nf-core/tools/pull/3237)) - add `--dir/-d` option to schema commands ([#3247](https://github.com/nf-core/tools/pull/3247)) -- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.1 ([#3250](https://github.com/nf-core/tools/pull/3250)) +- fix headers in api docs ([#3323](https://github.com/nf-core/tools/pull/3323)) - handle new schema structure in `nf-core pipelines create-params-file` ([#3276](https://github.com/nf-core/tools/pull/3276)) - Update Gitpod image to use Miniforge instead of Miniconda([#3274](https://github.com/nf-core/tools/pull/3274)) -- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.3 ([#3275](https://github.com/nf-core/tools/pull/3275)) - Add hint to solve git errors with a synced repo ([#3279](https://github.com/nf-core/tools/pull/3279)) -- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.4 ([#3282](https://github.com/nf-core/tools/pull/3282)) +- Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280)) +- Make CLI prompt less nf-core specific ([#3326](https://github.com/nf-core/tools/pull/3326)) +- Update gitpod vscode extensions to use nf-core extension pack ([#3327](https://github.com/nf-core/tools/pull/3327)) +- Remove toList() channel operation from inside onComplete block ([#3304](https://github.com/nf-core/tools/pull/3304)) +- build: Setup VS Code tests ([#3292](https://github.com/nf-core/tools/pull/3292)) +- Don't break gitpod.yml with template string ([#3332](https://github.com/nf-core/tools/pull/3332)) +- rocrate: remove duplicated entries for name and version ([#3333](https://github.com/nf-core/tools/pull/3333)) +- rocrate: Update crate with version bump and handle new contributor field ([#3334](https://github.com/nf-core/tools/pull/3334)) +- set default_branch to master for now ([#3335](https://github.com/nf-core/tools/issues/3335)) +- Set git defaultBranch to master in sync action ([#3337](https://github.com/nf-core/tools/pull/3337)) +- Add verbose mode to sync action ([#3339](https://github.com/nf-core/tools/pull/3339)) + +### Version updates + +- chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v1.12.0 ([#3230](https://github.com/nf-core/tools/pull/3230)) - Update codecov/codecov-action action to v5 ([#3283](https://github.com/nf-core/tools/pull/3283)) -- Update python:3.12-slim Docker digest to 2a6386a ([#3284](https://github.com/nf-core/tools/pull/3284)) -- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0 ([#3299](https://github.com/nf-core/tools/pull/3299)) - Update gitpod/workspace-base Docker digest to 12853f7 ([#3309](https://github.com/nf-core/tools/pull/3309)) -- Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280)) +- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.2 ([#3325](https://github.com/nf-core/tools/pull/3325)) ## [v3.0.2 - Titanium Tapir Patch](https://github.com/nf-core/tools/releases/tag/3.0.2) - [2024-10-11] diff --git a/Dockerfile b/Dockerfile index dc9948ea4b..f2141145b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim@sha256:2a6386ad2db20e7f55073f69a98d6da2cf9f168e05e7487d2670baeb9b7601c5 +FROM python:3.12-slim@sha256:2b0079146a74e23bf4ae8f6a28e1b484c6292f6fb904cbb51825b4a19812fcd8 LABEL authors="phil.ewels@seqera.io,erik.danielsson@scilifelab.se" \ description="Docker image containing requirements for nf-core/tools" diff --git a/docs/api/_src/api/pipelines/bump_version.md b/docs/api/_src/api/pipelines/bump_version.md index cd7dc280f6..76db67837a 100644 --- a/docs/api/_src/api/pipelines/bump_version.md +++ b/docs/api/_src/api/pipelines/bump_version.md @@ -1,4 +1,4 @@ -# nf_core.bump_version +# nf_core.pipelines.bump_version ```{eval-rst} .. automodule:: nf_core.pipelines.bump_version diff --git a/docs/api/_src/api/pipelines/create.md b/docs/api/_src/api/pipelines/create.md index 576335e951..5019a5f3c8 100644 --- a/docs/api/_src/api/pipelines/create.md +++ b/docs/api/_src/api/pipelines/create.md @@ -1,4 +1,4 @@ -# nf_core.create +# nf_core.pipelines.create ```{eval-rst} .. automodule:: nf_core.pipelines.create diff --git a/docs/api/_src/api/pipelines/download.md b/docs/api/_src/api/pipelines/download.md index 540fb92c49..afb31ddea6 100644 --- a/docs/api/_src/api/pipelines/download.md +++ b/docs/api/_src/api/pipelines/download.md @@ -1,4 +1,4 @@ -# nf_core.download +# nf_core.pipelines.download ```{eval-rst} .. automodule:: nf_core.pipelines.download diff --git a/docs/api/_src/api/pipelines/launch.md b/docs/api/_src/api/pipelines/launch.md index 0f7fc03f64..0d0260cae6 100644 --- a/docs/api/_src/api/pipelines/launch.md +++ b/docs/api/_src/api/pipelines/launch.md @@ -1,4 +1,4 @@ -# nf_core.launch +# nf_core.pipelines.launch ```{eval-rst} .. automodule:: nf_core.pipelines.launch diff --git a/docs/api/_src/api/pipelines/lint.md b/docs/api/_src/api/pipelines/lint.md index aa62c404b8..91b37c26f6 100644 --- a/docs/api/_src/api/pipelines/lint.md +++ b/docs/api/_src/api/pipelines/lint.md @@ -1,4 +1,4 @@ -# nf_core.lint +# nf_core.pipelines.lint :::{seealso} See the [Lint Tests](/docs/nf-core-tools/api_reference/dev/pipeline_lint_tests) docs for information about specific linting functions. diff --git a/docs/api/_src/api/pipelines/list.md b/docs/api/_src/api/pipelines/list.md index 7df7564544..5f404b91c3 100644 --- a/docs/api/_src/api/pipelines/list.md +++ b/docs/api/_src/api/pipelines/list.md @@ -1,4 +1,4 @@ -# nf_core.list +# nf_core.pipelines.list ```{eval-rst} .. automodule:: nf_core.pipelines.list diff --git a/docs/api/_src/api/pipelines/params-file.md b/docs/api/_src/api/pipelines/params-file.md index 06f27cc592..37e91f458a 100644 --- a/docs/api/_src/api/pipelines/params-file.md +++ b/docs/api/_src/api/pipelines/params-file.md @@ -1,4 +1,4 @@ -# nf_core.params_file +# nf_core.pipelines.params_file ```{eval-rst} .. automodule:: nf_core.pipelines.params_file diff --git a/docs/api/_src/api/pipelines/schema.md b/docs/api/_src/api/pipelines/schema.md index c885d9ed23..4ca1aab480 100644 --- a/docs/api/_src/api/pipelines/schema.md +++ b/docs/api/_src/api/pipelines/schema.md @@ -1,4 +1,4 @@ -# nf_core.schema +# nf_core.pipelines.schema ```{eval-rst} .. automodule:: nf_core.pipelines.schema diff --git a/docs/api/_src/api/pipelines/sync.md b/docs/api/_src/api/pipelines/sync.md index da1f468fe5..f78733bb7d 100644 --- a/docs/api/_src/api/pipelines/sync.md +++ b/docs/api/_src/api/pipelines/sync.md @@ -1,4 +1,4 @@ -# nf_core.sync +# nf_core.pipelines.sync ```{eval-rst} .. automodule:: nf_core.pipelines.sync diff --git a/docs/api/_src/api/pipelines/utils.md b/docs/api/_src/api/pipelines/utils.md index 86b8c3f36f..36c2ecca4d 100644 --- a/docs/api/_src/api/pipelines/utils.md +++ b/docs/api/_src/api/pipelines/utils.md @@ -1,4 +1,4 @@ -# nf_core.utils +# nf_core.pipelines.utils ```{eval-rst} .. automodule:: nf_core.pipelines.utils diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 06d4be8f75..7cfba64531 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -288,7 +288,7 @@ def command_pipelines_create(ctx, name, description, author, version, force, out @click.option( "--release", is_flag=True, - default=os.path.basename(os.path.dirname(os.environ.get("GITHUB_REF", "").strip(" '\""))) == "master" + default=Path(os.environ.get("GITHUB_REF", "").strip(" '\"")).parent.name in ["master", "main"] and os.environ.get("GITHUB_REPOSITORY", "").startswith("nf-core/") and not os.environ.get("GITHUB_REPOSITORY", "") == "nf-core/tools", help="Execute additional checks for release-ready workflows.", @@ -2240,7 +2240,7 @@ def command_download( @click.option( "--release", is_flag=True, - default=os.path.basename(os.path.dirname(os.environ.get("GITHUB_REF", "").strip(" '\""))) == "master" + default=Path(os.environ.get("GITHUB_REF", "").strip(" '\"")).parent.name in ["master", "main"] and os.environ.get("GITHUB_REPOSITORY", "").startswith("nf-core/") and not os.environ.get("GITHUB_REPOSITORY", "") == "nf-core/tools", help="Execute additional checks for release-ready workflows.", diff --git a/nf_core/components/components_utils.py b/nf_core/components/components_utils.py index be28a0d870..ab4cc79ae6 100644 --- a/nf_core/components/components_utils.py +++ b/nf_core/components/components_utils.py @@ -37,10 +37,10 @@ def get_repo_info(directory: Path, use_prompt: Optional[bool] = True) -> Tuple[P if not repo_type and use_prompt: log.warning("'repository_type' not defined in %s", config_fn.name) repo_type = questionary.select( - "Is this repository an nf-core pipeline or a fork of nf-core/modules?", + "Is this repository a pipeline or a modules repository?", choices=[ {"name": "Pipeline", "value": "pipeline"}, - {"name": "nf-core/modules", "value": "modules"}, + {"name": "Modules repository", "value": "modules"}, ], style=nf_core.utils.nfcore_question_style, ).unsafe_ask() diff --git a/nf_core/components/nfcore_component.py b/nf_core/components/nfcore_component.py index 37e43a536e..81c0ba98e7 100644 --- a/nf_core/components/nfcore_component.py +++ b/nf_core/components/nfcore_component.py @@ -62,7 +62,6 @@ def __init__( # Initialize the important files self.main_nf: Path = Path(self.component_dir, "main.nf") self.meta_yml: Optional[Path] = Path(self.component_dir, "meta.yml") - self.process_name = "" self.environment_yml: Optional[Path] = Path(self.component_dir, "environment.yml") component_list = self.component_name.split("/") @@ -96,6 +95,8 @@ def __init__( self.test_yml = None self.test_main_nf = None + self.process_name: str = self._get_process_name() + def __repr__(self) -> str: return f"" @@ -169,6 +170,13 @@ def _get_included_components_in_chained_tests(self, main_nf_test: Union[Path, st included_components.append(component) return included_components + def _get_process_name(self): + with open(self.main_nf) as fh: + for line in fh: + if re.search(r"^\s*process\s*\w*\s*{", line): + return re.search(r"^\s*process\s*(\w*)\s*{.*", line).group(1) or "" + return "" + def get_inputs_from_main_nf(self) -> None: """Collect all inputs from the main.nf file.""" inputs: Any = [] # Can be 'list[list[dict[str, dict[str, str]]]]' or 'list[str]' diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 848e17130e..ba3b87f79a 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -96,19 +96,19 @@ def main_nf( for line in iter_lines: if re.search(r"^\s*process\s*\w*\s*{", line) and state == "module": state = "process" - if re.search(r"input\s*:", line) and state in ["process"]: + if re.search(r"^\s*input\s*:", line) and state in ["process"]: state = "input" continue - if re.search(r"output\s*:", line) and state in ["input", "process"]: + if re.search(r"^\s*output\s*:", line) and state in ["input", "process"]: state = "output" continue - if re.search(r"when\s*:", line) and state in ["input", "output", "process"]: + if re.search(r"^\s*when\s*:", line) and state in ["input", "output", "process"]: state = "when" continue - if re.search(r"script\s*:", line) and state in ["input", "output", "when", "process"]: + if re.search(r"^\s*script\s*:", line) and state in ["input", "output", "when", "process"]: state = "script" continue - if re.search(r"shell\s*:", line) and state in ["input", "output", "when", "process"]: + if re.search(r"^\s*shell\s*:", line) and state in ["input", "output", "when", "process"]: state = "shell" continue @@ -256,7 +256,6 @@ def check_process_section(self, lines, registry, fix_version, progress_bar): bioconda_packages = [] # Process name should be all capital letters - self.process_name = lines[0].split()[1] if all(x.upper() for x in self.process_name): self.passed.append(("process_capitals", "Process name is in capital letters", self.main_nf)) else: diff --git a/nf_core/pipeline-template/.github/CONTRIBUTING.md b/nf_core/pipeline-template/.github/CONTRIBUTING.md index 37970c09e8..b08b43667f 100644 --- a/nf_core/pipeline-template/.github/CONTRIBUTING.md +++ b/nf_core/pipeline-template/.github/CONTRIBUTING.md @@ -64,9 +64,9 @@ These tests are run both with the latest available version of `Nextflow` and als :warning: Only in the unlikely and regretful event of a release happening with a bug. -- On your own fork, make a new branch `patch` based on `upstream/master`. +- On your own fork, make a new branch `patch` based on `upstream/main` or `upstream/master`. - Fix the bug, and bump version (X.Y.Z+1). -- Open a pull-request from `patch` to `master` with the changes. +- Open a pull-request from `patch` to `main`/`master` with the changes. {% if is_nfcore -%} diff --git a/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.yml b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.yml index 412f5bd3b3..f3624afc9c 100644 --- a/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.yml @@ -11,7 +11,6 @@ body: - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) - [{{ name }} pipeline documentation](https://nf-co.re/{{ short_name }}/usage) {%- endif %} - - type: textarea id: description attributes: diff --git a/nf_core/pipeline-template/.github/PULL_REQUEST_TEMPLATE.md b/nf_core/pipeline-template/.github/PULL_REQUEST_TEMPLATE.md index c96f2dd4c2..0df95c0a40 100644 --- a/nf_core/pipeline-template/.github/PULL_REQUEST_TEMPLATE.md +++ b/nf_core/pipeline-template/.github/PULL_REQUEST_TEMPLATE.md @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs). Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release. -Learn more about contributing: [CONTRIBUTING.md](https://github.com/{{ name }}/tree/master/.github/CONTRIBUTING.md) +Learn more about contributing: [CONTRIBUTING.md](https://github.com/{{ name }}/tree/{{ default_branch }}/.github/CONTRIBUTING.md) --> ## PR checklist - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ name }}/tree/master/.github/CONTRIBUTING.md) +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ name }}/tree/{{ default_branch }}/.github/CONTRIBUTING.md) {%- if is_nfcore %} - [ ] If necessary, also make a PR on the {{ name }} _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. {%- endif %} diff --git a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml index 1ca2ac2c74..6805c83a27 100644 --- a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -1,11 +1,12 @@ name: nf-core AWS full size tests -# This workflow is triggered on PRs opened against the master branch. +# This workflow is triggered on PRs opened against the main/master branch. # It can be additionally triggered manually with GitHub actions workflow dispatch button. # It runs the -profile 'test_full' on AWS batch on: pull_request: branches: + - main - master workflow_dispatch: pull_request_review: @@ -18,19 +19,30 @@ jobs: if: github.repository == '{{ name }}' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - uses: octokit/request-action@v2.x + - name: Get PR reviews + uses: octokit/request-action@v2.x if: github.event_name != 'workflow_dispatch' id: check_approvals + continue-on-error: true with: route: GET /repos/{%- raw -%}${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - id: test_variables + + - name: Check for approvals + if: ${{ failure() && github.event_name != 'workflow_dispatch' }} + run: | + echo "No review approvals found. At least 2 approvals are required to run this action automatically." + exit 1 + + - name: Check for enough approvals (>=2) + id: test_variables if: github.event_name != 'workflow_dispatch' run: | JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'{% endraw %} CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length') test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required + - name: Launch workflow via Seqera Platform uses: seqeralabs/action-tower-launch@v2 # TODO nf-core: You can customise AWS full pipeline tests as required diff --git a/nf_core/pipeline-template/.github/workflows/branch.yml b/nf_core/pipeline-template/.github/workflows/branch.yml index df1a627b15..110b4a5f5a 100644 --- a/nf_core/pipeline-template/.github/workflows/branch.yml +++ b/nf_core/pipeline-template/.github/workflows/branch.yml @@ -1,15 +1,17 @@ name: nf-core branch protection -# This workflow is triggered on PRs to master branch on the repository -# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` +# This workflow is triggered on PRs to `main`/`master` branch on the repository +# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` on: pull_request_target: - branches: [master] + branches: + - main + - master jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs if: github.repository == '{{ name }}' run: | @@ -22,7 +24,7 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | - ## This PR is against the `master` branch :x: + ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: * Do not close this PR * Click _Edit_ and change the `base` to `dev` @@ -32,9 +34,9 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. - The `master` branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. + It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch. + The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. + Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/nf_core/pipeline-template/.github/workflows/download_pipeline.yml b/nf_core/pipeline-template/.github/workflows/download_pipeline.yml index 1bc42469c4..f270dc5411 100644 --- a/nf_core/pipeline-template/.github/workflows/download_pipeline.yml +++ b/nf_core/pipeline-template/.github/workflows/download_pipeline.yml @@ -2,7 +2,7 @@ name: Test successful pipeline download with 'nf-core pipelines download' # Run the workflow when: # - dispatched manually -# - when a PR is opened or reopened to master branch +# - when a PR is opened or reopened to main/master branch # - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. on: workflow_dispatch: @@ -17,19 +17,25 @@ on: - edited - synchronize branches: + - main - master pull_request_target: branches: + - main - master env: NXF_ANSI_LOG: false jobs: - download: - runs-on: ubuntu-latest + configure: + runs-on: ubuntu-latest{% raw %} + outputs: + REPO_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPO_LOWERCASE }} + REPOTITLE_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }} + REPO_BRANCH: ${{ steps.get_repo_properties.outputs.REPO_BRANCH }} steps: - - name: Install Nextflow + - name: Install Nextflow{% endraw %} uses: nf-core/setup-nextflow@v2 - name: Disk space cleanup @@ -51,22 +57,27 @@ jobs: pip install git+https://github.com/nf-core/tools.git@dev - name: Get the repository name and current branch set as environment variable + id: get_repo_properties run: | - echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} - echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} - echo "{% raw %}REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV} + echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" + echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT" + echo "{% raw %}REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT" - name: Make a cache directory for the container images run: | mkdir -p ./singularity_container_images + download: + runs-on: ubuntu-latest + needs: configure + steps: - name: Download the pipeline env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images run: | - nf-core pipelines download ${{ env.REPO_LOWERCASE }} \ - --revision ${{ env.REPO_BRANCH }} \ - --outdir ./${{ env.REPOTITLE_LOWERCASE }} \ + nf-core pipelines download ${{ needs.configure.outputs.REPO_LOWERCASE }} \ + --revision ${{ needs.configure.outputs.REPO_BRANCH }} \ + --outdir ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} \ --compress "none" \ --container-system 'singularity' \ --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io/library/" \ @@ -74,14 +85,14 @@ jobs: --download-configuration 'yes' - name: Inspect download - run: tree ./${{ env.REPOTITLE_LOWERCASE }}{% endraw %}{% if test_config %}{% raw %} + run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}{% endraw %}{% if test_config %}{% raw %} - name: Count the downloaded number of container images id: count_initial run: | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) echo "Initial container image count: $image_count" - echo "IMAGE_COUNT_INITIAL=$image_count" >> ${GITHUB_ENV} + echo "IMAGE_COUNT_INITIAL=$image_count" >> "$GITHUB_OUTPUT" - name: Run the downloaded pipeline (stub) id: stub_run_pipeline @@ -89,27 +100,27 @@ jobs: env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images NXF_SINGULARITY_HOME_MOUNT: true - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results + run: nextflow run ./${{needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results - name: Run the downloaded pipeline (stub run not supported) id: run_pipeline - if: ${{ job.steps.stub_run_pipeline.status == failure() }} + if: ${{ steps.stub_run_pipeline.outcome == 'failure' }} env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images NXF_SINGULARITY_HOME_MOUNT: true - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results + run: nextflow run ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -profile test,singularity --outdir ./results - name: Count the downloaded number of container images id: count_afterwards run: | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) echo "Post-pipeline run container image count: $image_count" - echo "IMAGE_COUNT_AFTER=$image_count" >> ${GITHUB_ENV} + echo "IMAGE_COUNT_AFTER=$image_count" >> "$GITHUB_OUTPUT" - name: Compare container image counts run: | - if [ "${{ env.IMAGE_COUNT_INITIAL }}" -ne "${{ env.IMAGE_COUNT_AFTER }}" ]; then - initial_count=${{ env.IMAGE_COUNT_INITIAL }} - final_count=${{ env.IMAGE_COUNT_AFTER }} + if [ "${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }}" -ne "${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }}" ]; then + initial_count=${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }} + final_count=${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }} difference=$((final_count - initial_count)) echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!" tree ./singularity_container_images diff --git a/nf_core/pipeline-template/.gitpod.yml b/nf_core/pipeline-template/.gitpod.yml index 5907fb59c9..c6a2e40b87 100644 --- a/nf_core/pipeline-template/.gitpod.yml +++ b/nf_core/pipeline-template/.gitpod.yml @@ -3,16 +3,8 @@ tasks: - name: Update Nextflow and setup pre-commit command: | pre-commit install --install-hooks - nextflow self-update + nextflow self-update {%- if code_linters %} vscode: - extensions: # based on nf-core.nf-core-extensionpack - #{%- if code_linters -%} - - esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code - - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files{% endif %} - - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar - - mechatroner.rainbow-csv # Highlight columns in csv files in different colors - - nextflow.nextflow # Nextflow syntax highlighting - - oderwat.indent-rainbow # Highlight indentation level - - streetsidesoftware.code-spell-checker # Spelling checker for source code - - charliermarsh.ruff # Code linter Ruff + extensions: + - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack{% endif %} diff --git a/nf_core/pipeline-template/.prettierignore b/nf_core/pipeline-template/.prettierignore index 7ecc9b61cb..02ba84c006 100644 --- a/nf_core/pipeline-template/.prettierignore +++ b/nf_core/pipeline-template/.prettierignore @@ -16,3 +16,6 @@ testing/ testing* *.pyc bin/ +{%- if rocrate %} +ro-crate-metadata.json +{%- endif %} diff --git a/nf_core/pipeline-template/CITATIONS.md b/nf_core/pipeline-template/CITATIONS.md index 16da9a4207..c355fd6129 100644 --- a/nf_core/pipeline-template/CITATIONS.md +++ b/nf_core/pipeline-template/CITATIONS.md @@ -18,7 +18,7 @@ {%- endif %} -{% if multiqc %}- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/) +{%- if multiqc %}- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/) > Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924. diff --git a/nf_core/pipeline-template/README.md b/nf_core/pipeline-template/README.md index a8f2e60546..4cd41de368 100644 --- a/nf_core/pipeline-template/README.md +++ b/nf_core/pipeline-template/README.md @@ -7,7 +7,7 @@ -{% else %} +{%- else -%} # {{ name }} @@ -48,13 +48,13 @@ workflows use the "tube map" design for that. See https://nf-co.re/docs/contributing/design_guidelines#examples for examples. --> -{% if fastqc %}1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)){% endif %} -{% if multiqc %}2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/)){% endif %} +{%- if fastqc %}1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)){% endif %} +{%- if multiqc %}2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/)){% endif %} ## Usage > [!NOTE] -> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. {% if test_config %}Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.{% endif %} +> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. {%- if test_config %}Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.{% endif %} -{% if citations %} +{%- if citations %} An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file. -{% endif %} +{%- endif %} + {% if is_nfcore -%} You can cite the `nf-core` publication as follows: diff --git a/nf_core/pipeline-template/assets/schema_input.json b/nf_core/pipeline-template/assets/schema_input.json index 28a468adaf..0dbc03df56 100644 --- a/nf_core/pipeline-template/assets/schema_input.json +++ b/nf_core/pipeline-template/assets/schema_input.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/{{ name }}/master/assets/schema_input.json", + "$id": "https://raw.githubusercontent.com/{{ name }}/{{ default_branch }}/assets/schema_input.json", "title": "{{ name }} pipeline - params.input schema", "description": "Schema for the file provided with params.input", "type": "array", diff --git a/nf_core/pipeline-template/docs/output.md b/nf_core/pipeline-template/docs/output.md index 83d5d23fe3..a9be6620e1 100644 --- a/nf_core/pipeline-template/docs/output.md +++ b/nf_core/pipeline-template/docs/output.md @@ -2,7 +2,7 @@ ## Introduction -This document describes the output produced by the pipeline. {% if multiqc %}Most of the plots are taken from the MultiQC report, which summarises results at the end of the pipeline.{% endif %} +This document describes the output produced by the pipeline.{% if multiqc %} Most of the plots are taken from the MultiQC report, which summarises results at the end of the pipeline.{% endif %} The directories listed below will be created in the results directory after the pipeline has finished. All paths are relative to the top-level results directory. @@ -14,9 +14,8 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d {% if fastqc -%} -- [FastQC](#fastqc) - Raw read QC - {%- endif %} - {%- if multiqc %} +- [FastQC](#fastqc) - Raw read QC{% endif %} + {%- if multiqc -%} - [MultiQC](#multiqc) - Aggregate report describing results and QC from the whole pipeline {%- endif %} - [Pipeline information](#pipeline-information) - Report metrics generated during the workflow execution @@ -35,7 +34,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d [FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/) gives general quality metrics about your sequenced reads. It provides information about the quality score distribution across your reads, per base sequence content (%A/T/G/C), adapter contamination and overrepresented sequences. For further reading and documentation see the [FastQC help pages](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/). -{%- endif %} +{%- endif -%} {% if multiqc -%} @@ -54,7 +53,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d [MultiQC](http://multiqc.info) is a visualization tool that generates a single HTML report summarising all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory. Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQC. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use MultiQC reports, see . -{%- endif %} +{%- endif -%} ### Pipeline information diff --git a/nf_core/pipeline-template/docs/usage.md b/nf_core/pipeline-template/docs/usage.md index 16e6220aaf..bbc8a828c4 100644 --- a/nf_core/pipeline-template/docs/usage.md +++ b/nf_core/pipeline-template/docs/usage.md @@ -61,7 +61,7 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p The typical command for running the pipeline is as follows: ```bash -nextflow run {{ name }} --input ./samplesheet.csv --outdir ./results --genome GRCh37 -profile docker +nextflow run {{ name }} --input ./samplesheet.csv --outdir ./results {% if igenomes %}--genome GRCh37{% endif %} -profile docker ``` This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. @@ -93,7 +93,9 @@ with: ```yaml title="params.yaml" input: './samplesheet.csv' outdir: './results/' +{% if igenomes -%} genome: 'GRCh37' +{% endif -%} <...> ``` @@ -113,7 +115,7 @@ It is a good idea to specify the pipeline version when running the pipeline on y First, go to the [{{ name }} releases page](https://github.com/{{ name }}/releases) and find the latest pipeline version - numeric only (eg. `1.3.1`). Then specify this when running the pipeline with `-r` (one hyphen) - eg. `-r 1.3.1`. Of course, you can switch to another version by changing the number after the `-r` flag. -This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future. {% if multiqc %}For example, at the bottom of the MultiQC reports.{% endif %} +This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future.{% if multiqc %} For example, at the bottom of the MultiQC reports.{% endif %} To further assist in reproducibility, you can use share and reuse [parameter files](#running-the-pipeline) to repeat pipeline runs with the same settings without having to write out a command with every single parameter. @@ -136,7 +138,7 @@ Several generic profiles are bundled with the pipeline which instruct the pipeli {%- if nf_core_configs %} -The pipeline also dynamically loads configurations from [https://github.com/nf-core/configs](https://github.com/nf-core/configs) when it runs, making multiple config profiles for various institutional clusters available at run time. For more information and to check if your system is suported, please see the [nf-core/configs documentation](https://github.com/nf-core/configs#documentation). +The pipeline also dynamically loads configurations from [https://github.com/nf-core/configs](https://github.com/nf-core/configs) when it runs, making multiple config profiles for various institutional clusters available at run time. For more information and to check if your system is supported, please see the [nf-core/configs documentation](https://github.com/nf-core/configs#documentation). {% else %} {% endif %} Note that multiple profiles can be loaded, for example: `-profile test,docker` - the order of arguments is important! diff --git a/nf_core/pipeline-template/modules.json b/nf_core/pipeline-template/modules.json index 90c5728d9a..7d2761d290 100644 --- a/nf_core/pipeline-template/modules.json +++ b/nf_core/pipeline-template/modules.json @@ -28,7 +28,7 @@ }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "9a1e8bb6a5d205cf7807dcefca872a3314b2f3e6", + "git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a", "installed_by": ["subworkflows"] }{% if nf_schema %}, "utils_nfschema_plugin": { diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 21174bbdc5..3325af4e06 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -77,11 +77,6 @@ params { includeConfig 'conf/base.config' {%- else %} -{% if modules -%} -// Load modules.config for DSL2 module specific options -includeConfig 'conf/modules.config' -{%- endif %} - process { // TODO nf-core: Check the defaults for all processes cpus = { 1 * task.attempt } @@ -291,6 +286,7 @@ manifest { homePage = 'https://github.com/{{ name }}' description = """{{ description }}""" mainScript = 'main.nf' + defaultBranch = '{{ default_branch }}' nextflowVersion = '!>=24.04.2' version = '{{ version }}' doi = '' @@ -310,7 +306,7 @@ validation { command = "nextflow run {{ name }} -profile --input samplesheet.csv --outdir " fullParameter = "help_full" showHiddenParameter = "show_hidden" - {% if is_nfcore -%} + {%- if is_nfcore %} beforeText = """ -\033[2m----------------------------------------------------\033[0m- \033[0;32m,--.\033[0;30m/\033[0;32m,-.\033[0m @@ -326,7 +322,7 @@ validation { https://doi.org/10.1038/s41587-020-0439-x * Software dependencies - https://github.com/{{ name }}/blob/master/CITATIONS.md + https://github.com/{{ name }}/blob/{{ default_branch }}/CITATIONS.md """{% endif %} }{% if is_nfcore %} summary { @@ -335,3 +331,8 @@ validation { }{% endif %} } {%- endif %} + +{% if modules -%} +// Load modules.config for DSL2 module specific options +includeConfig 'conf/modules.config' +{%- endif %} diff --git a/nf_core/pipeline-template/nextflow_schema.json b/nf_core/pipeline-template/nextflow_schema.json index 3e59a8ba54..c28929b47d 100644 --- a/nf_core/pipeline-template/nextflow_schema.json +++ b/nf_core/pipeline-template/nextflow_schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/{{ name }}/master/nextflow_schema.json", + "$id": "https://raw.githubusercontent.com/{{ name }}/{{ default_branch }}/nextflow_schema.json", "title": "{{ name }} pipeline parameters", "description": "{{ description }}", "type": "object", @@ -243,10 +243,12 @@ { "$ref": "#/$defs/input_output_options" }, - {% if igenomes %}{ + {%- if igenomes %} + { "$ref": "#/$defs/reference_genome_options" },{% endif %} - {% if nf_core_configs %}{ + {%- if nf_core_configs %} + { "$ref": "#/$defs/institutional_config_options" },{% endif %} { diff --git a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf index be5776b836..3d540600ba 100644 --- a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf @@ -140,6 +140,10 @@ workflow PIPELINE_COMPLETION { summary_params = [:] {%- endif %} + {%- if multiqc %} + def multiqc_reports = multiqc_report.toList() + {%- endif %} + // // Completion email and summary // @@ -153,7 +157,7 @@ workflow PIPELINE_COMPLETION { plaintext_email, outdir, monochrome_logs, - {% if multiqc %}multiqc_report.toList(){% else %}[]{% endif %} + {% if multiqc %}multiqc_reports.getVal(),{% else %}[]{% endif %} ) } {%- endif %} diff --git a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index 228dbff897..bfd258760d 100644 --- a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -203,29 +203,24 @@ def logColours(monochrome_logs=true) { return colorcodes } +// Return a single report from an object that may be a Path or List // -// Attach the multiqc report to email -// -def attachMultiqcReport(multiqc_report) { - def mqc_report = null - try { - if (workflow.success) { - mqc_report = multiqc_report.getVal() - if (mqc_report.getClass() == ArrayList && mqc_report.size() >= 1) { - if (mqc_report.size() > 1) { - log.warn("[${workflow.manifest.name}] Found multiple reports from process 'MULTIQC', will use only one") - } - mqc_report = mqc_report[0] - } +def getSingleReport(multiqc_reports) { + if (multiqc_reports instanceof Path) { + return multiqc_reports + } else if (multiqc_reports instanceof List) { + if (multiqc_reports.size() == 0) { + log.warn("[${workflow.manifest.name}] No reports found from process 'MULTIQC'") + return null + } else if (multiqc_reports.size() == 1) { + return multiqc_reports.first() + } else { + log.warn("[${workflow.manifest.name}] Found multiple reports from process 'MULTIQC', will use only one") + return multiqc_reports.first() } + } else { + return null } - catch (Exception msg) { - log.debug(msg) - if (multiqc_report) { - log.warn("[${workflow.manifest.name}] Could not attach MultiQC report to summary email") - } - } - return mqc_report } // @@ -279,7 +274,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi email_fields['summary'] = summary << misc_fields // On success try attach the multiqc report - def mqc_report = attachMultiqcReport(multiqc_report) + def mqc_report = getSingleReport(multiqc_report) // Check if we are only sending emails on failure def email_address = email @@ -310,7 +305,8 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi if (email_address) { try { if (plaintext_email) { -new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') } + new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') + } // Try to send HTML e-mail using sendmail def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html") sendmail_tf.withWriter { w -> w << sendmail_html } @@ -318,7 +314,7 @@ new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') log.info("-${colors.purple}[${workflow.manifest.name}]${colors.green} Sent summary e-mail to ${email_address} (sendmail)-") } catch (Exception msg) { - log.debug(msg) + log.debug(msg.toString()) log.debug("Trying with mail instead of sendmail") // Catch failures and try with plaintext def mail_cmd = ['mail', '-s', subject, '--content-type=text/html', email_address] diff --git a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test index e43d208b1b..f117040cbd 100644 --- a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test +++ b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test @@ -79,4 +79,48 @@ nextflow_function { ) } } + + test("Test Function getSingleReport with a single file") { + function "getSingleReport" + + when { + function { + """ + input[0] = file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert function.result.contains("test.tsv") } + ) + } + } + + test("Test Function getSingleReport with multiple files") { + function "getSingleReport" + + when { + function { + """ + input[0] = [ + file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true), + file(params.modules_testdata_base_path + '/generic/tsv/network.tsv', checkIfExists: true), + file(params.modules_testdata_base_path + '/generic/tsv/expression.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert function.result.contains("test.tsv") }, + { assert !function.result.contains("network.tsv") }, + { assert !function.result.contains("expression.tsv") } + ) + } + } } diff --git a/nf_core/pipelines/bump_version.py b/nf_core/pipelines/bump_version.py index 3190ed70d4..664d7a22a3 100644 --- a/nf_core/pipelines/bump_version.py +++ b/nf_core/pipelines/bump_version.py @@ -11,6 +11,7 @@ from ruamel.yaml import YAML import nf_core.utils +from nf_core.pipelines.rocrate import ROCrate from nf_core.utils import Pipeline log = logging.getLogger(__name__) @@ -127,6 +128,10 @@ def bump_pipeline_version(pipeline_obj: Pipeline, new_version: str) -> None: yaml_key=["template", "version"], ) + # update rocrate if ro-crate is present + if Path(pipeline_obj.wf_path, "ro-crate-metadata.json").exists(): + ROCrate(pipeline_obj.wf_path).update_rocrate() + def bump_nextflow_version(pipeline_obj: Pipeline, new_version: str) -> None: """Bumps the required Nextflow version number of a pipeline. diff --git a/nf_core/pipelines/create/create.py b/nf_core/pipelines/create/create.py index 61e0b63ec3..4f90ca17f9 100644 --- a/nf_core/pipelines/create/create.py +++ b/nf_core/pipelines/create/create.py @@ -22,7 +22,7 @@ from nf_core.pipelines.create_logo import create_logo from nf_core.pipelines.lint_utils import run_prettier_on_file from nf_core.pipelines.rocrate import ROCrate -from nf_core.utils import NFCoreTemplateConfig, NFCoreYamlLintConfig +from nf_core.utils import NFCoreTemplateConfig, NFCoreYamlLintConfig, custom_yaml_dumper log = logging.getLogger(__name__) @@ -57,7 +57,7 @@ def __init__( template_config: Optional[Union[CreateConfig, str, Path]] = None, organisation: str = "nf-core", from_config_file: bool = False, - default_branch: Optional[str] = None, + default_branch: str = "master", is_interactive: bool = False, ) -> None: if isinstance(template_config, CreateConfig): @@ -87,8 +87,17 @@ def __init__( # Read features yaml file self.template_features_yml = load_features_yaml() + # Set fields used by the class methods + self.no_git = no_git + self.default_branch = default_branch + self.is_interactive = is_interactive + if self.config.outdir is None: self.config.outdir = str(Path.cwd()) + + # Get the default branch name from the Git configuration + self.get_default_branch() + self.jinja_params, self.skip_areas = self.obtain_jinja_params_dict( self.config.skip_features or [], str(self.config.outdir) ) @@ -107,11 +116,6 @@ def __init__( # Set convenience variables self.name = self.config.name - - # Set fields used by the class methods - self.no_git = no_git - self.default_branch = default_branch - self.is_interactive = is_interactive self.force = self.config.force if self.config.outdir == ".": @@ -233,6 +237,7 @@ def obtain_jinja_params_dict( jinja_params["name_docker"] = jinja_params["name"].replace(jinja_params["org"], jinja_params["prefix_nodash"]) jinja_params["logo_light"] = f"{jinja_params['name_noslash']}_logo_light.png" jinja_params["logo_dark"] = f"{jinja_params['name_noslash']}_logo_dark.png" + jinja_params["default_branch"] = self.default_branch if config_yml is not None: if ( hasattr(config_yml, "lint") @@ -254,12 +259,21 @@ def obtain_jinja_params_dict( def init_pipeline(self): """Creates the nf-core pipeline.""" + # Make the new pipeline self.render_template() # Init the git repository and make the first commit if not self.no_git: self.git_init_pipeline() + # Run prettier on files + if self.config.skip_features is None or not ( + "code_linters" in self.config.skip_features or "github" in self.config.skip_features + ): + current_dir = Path.cwd() + os.chdir(self.outdir) + run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")]) + os.chdir(current_dir) if self.config.is_nfcore and not self.is_interactive: log.info( @@ -292,7 +306,6 @@ def render_template(self) -> None: template_dir = Path(nf_core.__file__).parent / "pipeline-template" object_attrs = self.jinja_params object_attrs["nf_core_version"] = nf_core.__version__ - # Can't use glob.glob() as need recursive hidden dotfiles - https://stackoverflow.com/a/58126417/713980 template_files = list(Path(template_dir).glob("**/*")) template_files += list(Path(template_dir).glob("*")) @@ -357,7 +370,7 @@ def render_template(self) -> None: # Make a logo and save it, if it is a nf-core pipeline self.make_pipeline_logo() - if self.config.skip_features is None or "ro-crate" not in self.config.skip_features: + if self.config.skip_features is None or "rocrate" not in self.config.skip_features: # Create the RO-Crate metadata file rocrate_obj = ROCrate(self.outdir) rocrate_obj.create_rocrate(json_path=self.outdir / "ro-crate-metadata.json") @@ -370,12 +383,9 @@ def render_template(self) -> None: if config_fn is not None and config_yml is not None: with open(str(config_fn), "w") as fh: config_yml.template = NFCoreTemplateConfig(**self.config.model_dump(exclude_none=True)) - yaml.safe_dump(config_yml.model_dump(exclude_none=True), fh) + yaml.dump(config_yml.model_dump(exclude_none=True), fh, Dumper=custom_yaml_dumper()) log.debug(f"Dumping pipeline template yml to pipeline config file '{config_fn.name}'") - # Run prettier on files - run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")]) - def fix_linting(self): """ Updates the .nf-core.yml with linting configurations @@ -403,7 +413,13 @@ def fix_linting(self): if config_fn is not None and nf_core_yml is not None: nf_core_yml.lint = NFCoreYamlLintConfig(**lint_config) with open(self.outdir / config_fn, "w") as fh: - yaml.dump(nf_core_yml.model_dump(exclude_none=True), fh, default_flow_style=False, sort_keys=False) + yaml.dump( + nf_core_yml.model_dump(exclude_none=True), + fh, + sort_keys=False, + default_flow_style=False, + Dumper=custom_yaml_dumper(), + ) def make_pipeline_logo(self): """Fetch a logo for the new pipeline from the nf-core website""" @@ -421,20 +437,18 @@ def make_pipeline_logo(self): force=bool(self.force), ) - def git_init_pipeline(self) -> None: - """Initialises the new pipeline as a Git repository and submits first commit. - - Raises: - UserWarning: if Git default branch is set to 'dev' or 'TEMPLATE'. - """ - default_branch: Optional[str] = self.default_branch + def get_default_branch(self) -> None: + """Gets the default branch name from the Git configuration.""" try: - default_branch = default_branch or str(git.config.GitConfigParser().get_value("init", "defaultBranch")) + self.default_branch = ( + str(git.config.GitConfigParser().get_value("init", "defaultBranch")) or "master" + ) # default to master + log.debug(f"Default branch name: {self.default_branch}") except configparser.Error: log.debug("Could not read init.defaultBranch") - if default_branch in ["dev", "TEMPLATE"]: + if self.default_branch in ["dev", "TEMPLATE"]: raise UserWarning( - f"Your Git defaultBranch '{default_branch}' is incompatible with nf-core.\n" + f"Your Git defaultBranch '{self.default_branch}' is incompatible with nf-core.\n" "'dev' and 'TEMPLATE' can not be used as default branch name.\n" "Set the default branch name with " "[white on grey23] git config --global init.defaultBranch [/]\n" @@ -442,12 +456,19 @@ def git_init_pipeline(self) -> None: "Pipeline git repository will not be initialised." ) + def git_init_pipeline(self) -> None: + """Initialises the new pipeline as a Git repository and submits first commit. + + Raises: + UserWarning: if Git default branch is set to 'dev' or 'TEMPLATE'. + """ + log.info("Initialising local pipeline git repository") repo = git.Repo.init(self.outdir) repo.git.add(A=True) repo.index.commit(f"initial template build from nf-core/tools, version {nf_core.__version__}") - if default_branch: - repo.active_branch.rename(default_branch) + if self.default_branch: + repo.active_branch.rename(self.default_branch) try: repo.git.branch("TEMPLATE") repo.git.branch("dev") diff --git a/nf_core/pipelines/create/template_features.yml b/nf_core/pipelines/create/template_features.yml index 9841879e83..fa24debffe 100644 --- a/nf_core/pipelines/create/template_features.yml +++ b/nf_core/pipelines/create/template_features.yml @@ -148,6 +148,10 @@ is_nfcore: - "docs/images/nf-core-{{short_name}}_logo_light.png" - "docs/images/nf-core-{{short_name}}_logo_dark.png" - ".github/ISSUE_TEMPLATE/bug_report.yml" + - ".github/CONTRIBUTING.md" + - ".github/PULL_REQUEST_TEMPLATE.md" + - "assets/email_template.txt" + - "docs/README.md" nextflow_config: - "manifest.name" - "manifest.homePage" @@ -445,6 +449,8 @@ rocrate: linting: files_warn: - "ro-crate-metadata.json" + files_unchanged: + - ".prettierignore" vscode: skippable_paths: - ".vscode" diff --git a/nf_core/pipelines/download.py b/nf_core/pipelines/download.py index d37dce86d1..11adebce2c 100644 --- a/nf_core/pipelines/download.py +++ b/nf_core/pipelines/download.py @@ -1744,7 +1744,7 @@ def tidy_tags_and_branches(self): for tag in tags_to_remove: self.repo.delete_tag(tag) - # switch to a revision that should be kept, because deleting heads fails, if they are checked out (e.g. "master") + # switch to a revision that should be kept, because deleting heads fails, if they are checked out (e.g. "main") self.checkout(self.revision[0]) # delete unwanted heads/branches from repository diff --git a/nf_core/pipelines/lint/actions_awsfulltest.py b/nf_core/pipelines/lint/actions_awsfulltest.py index 7ea167f6c9..080ae3583e 100644 --- a/nf_core/pipelines/lint/actions_awsfulltest.py +++ b/nf_core/pipelines/lint/actions_awsfulltest.py @@ -42,7 +42,7 @@ def actions_awsfulltest(self) -> Dict[str, List[str]]: # Check that the action is only turned on for published releases try: - if wf[True]["pull_request"]["branches"] != ["master"]: + if wf[True]["pull_request"]["branches"] != ["main", "master"]: raise AssertionError() if wf[True]["pull_request_review"]["types"] != ["submitted"]: raise AssertionError() diff --git a/nf_core/pipelines/lint/version_consistency.py b/nf_core/pipelines/lint/version_consistency.py index 5fe24ed723..2f9cead83c 100644 --- a/nf_core/pipelines/lint/version_consistency.py +++ b/nf_core/pipelines/lint/version_consistency.py @@ -5,7 +5,7 @@ def version_consistency(self): """Pipeline and container version number consistency. .. note:: This test only runs when the ``--release`` flag is set for ``nf-core pipelines lint``, - or ``$GITHUB_REF`` is equal to ``master``. + or ``$GITHUB_REF`` is equal to ``main``. This lint fetches the pipeline version number from three possible locations: diff --git a/nf_core/pipelines/lint_utils.py b/nf_core/pipelines/lint_utils.py index b4c56c6007..a6b98b1899 100644 --- a/nf_core/pipelines/lint_utils.py +++ b/nf_core/pipelines/lint_utils.py @@ -97,7 +97,7 @@ def run_prettier_on_file(file: Union[Path, str, List[str]]) -> None: all_lines = [line for line in e.stdout.decode().split("\n")] files = "\n".join(all_lines[3:]) log.debug(f"The following files were modified by prettier:\n {files}") - elif e.stderr.decode(): + else: log.warning( "There was an error running the prettier pre-commit hook.\n" f"STDOUT: {e.stdout.decode()}\nSTDERR: {e.stderr.decode()}" diff --git a/nf_core/pipelines/rocrate.py b/nf_core/pipelines/rocrate.py index 915f203f00..bc868273c4 100644 --- a/nf_core/pipelines/rocrate.py +++ b/nf_core/pipelines/rocrate.py @@ -216,6 +216,9 @@ def set_main_entity(self, main_entity_filename: str): ) self.crate.mainEntity.append_to("version", self.version, compact=True) + # remove duplicate entries for version + self.crate.mainEntity["version"] = list(set(self.crate.mainEntity["version"])) + # get keywords from nf-core website remote_workflows = requests.get("https://nf-co.re/pipelines.json").json()["remote_workflows"] # go through all remote workflows and find the one that matches the pipeline name @@ -236,6 +239,9 @@ def set_main_entity(self, main_entity_filename: str): self.crate.mainEntity.append_to("license", self.crate.license) self.crate.mainEntity.append_to("name", self.crate.name) + # remove duplicate entries for name + self.crate.mainEntity["name"] = list(set(self.crate.mainEntity["name"])) + if "dev" in self.version: self.crate.creativeWorkStatus = "InProgress" else: @@ -261,14 +267,26 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None: # add author entity to crate try: - authors = self.pipeline_obj.nf_config["manifest.author"].split(",") - # remove spaces - authors = [a.strip() for a in authors] + authors = [] + if "manifest.author" in self.pipeline_obj.nf_config: + authors.extend([a.strip() for a in self.pipeline_obj.nf_config["manifest.author"].split(",")]) + if "manifest.contributor" in self.pipeline_obj.nf_config: + authors.extend( + [ + c.get("name", "").strip() + for c in self.pipeline_obj.nf_config["manifest.contributor"] + if "name" in c + ] + ) + if not authors: + raise KeyError("No authors found") # add manifest authors as maintainer to crate except KeyError: - log.error("No author field found in manifest of nextflow.config") + log.error("No author or contributor fields found in manifest of nextflow.config") return + # remove duplicates + authors = list(set(authors)) # look at git contributors for author names try: git_contributors: Set[str] = set() @@ -330,6 +348,25 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None: if author in authors: wf_file.append_to("maintainer", author_entitity) + def update_rocrate(self) -> bool: + """ + Update the rocrate file + """ + # check if we need to output a json file and/or a zip file based on the file extensions + # try to find a json file + json_path: Optional[Path] = None + potential_json_path = Path(self.pipeline_dir, "ro-crate-metadata.json") + if potential_json_path.exists(): + json_path = potential_json_path + + # try to find a zip file + zip_path: Optional[Path] = None + potential_zip_path = Path(self.pipeline_dir, "ro-crate.crate.zip") + if potential_zip_path.exists(): + zip_path = potential_zip_path + + return self.create_rocrate(json_path=json_path, zip_path=zip_path) + def get_orcid(name: str) -> Optional[str]: """ diff --git a/nf_core/pipelines/schema.py b/nf_core/pipelines/schema.py index 61fd6bc2d7..a08dd0a2d0 100644 --- a/nf_core/pipelines/schema.py +++ b/nf_core/pipelines/schema.py @@ -517,11 +517,13 @@ def validate_schema_title_description(self, schema=None): if "title" not in self.schema: raise AssertionError("Schema missing top-level `title` attribute") # Validate that id, title and description match the pipeline manifest - id_attr = "https://raw.githubusercontent.com/{}/master/nextflow_schema.json".format( + id_attr = "https://raw.githubusercontent.com/{}/main/nextflow_schema.json".format( self.pipeline_manifest["name"].strip("\"'") ) - if self.schema["$id"] != id_attr: - raise AssertionError(f"Schema `$id` should be `{id_attr}`\n Found `{self.schema['$id']}`") + if self.schema["$id"] not in [id_attr, id_attr.replace("/main/", "/master/")]: + raise AssertionError( + f"Schema `$id` should be `{id_attr}` or {id_attr.replace('/main/', '/master/')}. \n Found `{self.schema['$id']}`" + ) title_attr = "{} pipeline parameters".format(self.pipeline_manifest["name"].strip("\"'")) if self.schema["title"] != title_attr: diff --git a/nf_core/subworkflows/lint/subworkflow_tests.py b/nf_core/subworkflows/lint/subworkflow_tests.py index 7ca825f04f..8e9e62430a 100644 --- a/nf_core/subworkflows/lint/subworkflow_tests.py +++ b/nf_core/subworkflows/lint/subworkflow_tests.py @@ -50,7 +50,7 @@ def subworkflow_tests(_, subworkflow: NFCoreComponent): subworkflow.warned.append( ( "test_dir_exists", - "nf-test directory is missing", + "Migrate pytest-workflow to nf-test", subworkflow.nftest_testdir, ) ) diff --git a/nf_core/synced_repo.py b/nf_core/synced_repo.py index efb7a8e03e..43f9b8046e 100644 --- a/nf_core/synced_repo.py +++ b/nf_core/synced_repo.py @@ -9,10 +9,7 @@ import git from git.exc import GitCommandError -from nf_core.components.constants import ( - NF_CORE_MODULES_NAME, - NF_CORE_MODULES_REMOTE, -) +from nf_core.components.constants import NF_CORE_MODULES_DEFAULT_BRANCH, NF_CORE_MODULES_NAME, NF_CORE_MODULES_REMOTE from nf_core.utils import load_tools_config log = logging.getLogger(__name__) @@ -186,7 +183,7 @@ def setup_branch(self, branch): if branch is None: # Don't bother fetching default branch if we're using nf-core if self.remote_url == NF_CORE_MODULES_REMOTE: - self.branch = "master" + self.branch = NF_CORE_MODULES_DEFAULT_BRANCH else: self.branch = self.get_default_branch() else: diff --git a/nf_core/utils.py b/nf_core/utils.py index 30b0743493..dc208c0a78 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1083,7 +1083,7 @@ def get_repo_releases_branches(pipeline, wfs): raise AssertionError(f"Not able to find pipeline '{pipeline}'") # Get branch information from github api - should be no need to check if the repo exists again - branch_response = gh_api.safe_get(f"https://api.github.com/repos/{pipeline}/branches") + branch_response = gh_api.safe_get(f"https://api.github.com/repos/{pipeline}/branches?per_page=100") for branch in branch_response.json(): if ( branch["name"] != "TEMPLATE" diff --git a/requirements-dev.txt b/requirements-dev.txt index aab9b1e5d7..04c6372d72 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ responses ruff Sphinx sphinx-rtd-theme -textual-dev==1.6.1 +textual-dev==1.5.1 types-PyYAML types-requests types-jsonschema diff --git a/setup.py b/setup.py index 11b3022494..b5c5de9a4f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup -version = "3.0.3dev" +version = "3.1.1dev" with open("README.md") as f: readme = f.read() diff --git a/tests/pipelines/lint/test_actions_awstest.py b/tests/pipelines/lint/test_actions_awstest.py index 51b55cb867..01dc9f6168 100644 --- a/tests/pipelines/lint/test_actions_awstest.py +++ b/tests/pipelines/lint/test_actions_awstest.py @@ -24,7 +24,7 @@ def test_actions_awstest_fail(self): new_pipeline = self._make_pipeline_copy() with open(Path(new_pipeline, ".github", "workflows", "awstest.yml")) as fh: awstest_yml = yaml.safe_load(fh) - awstest_yml[True]["push"] = ["master"] + awstest_yml[True]["push"] = ["main"] with open(Path(new_pipeline, ".github", "workflows", "awstest.yml"), "w") as fh: yaml.dump(awstest_yml, fh) diff --git a/tests/pipelines/test_lint.py b/tests/pipelines/test_lint.py index ca7353d50d..f33ac3a2ee 100644 --- a/tests/pipelines/test_lint.py +++ b/tests/pipelines/test_lint.py @@ -25,7 +25,7 @@ def setUp(self) -> None: ########################## class TestPipelinesLint(TestLint): def test_run_linting_function(self): - """Run the master run_linting() function in lint.py + """Run the run_linting() function in lint.py We don't really check any of this code as it's just a series of function calls and we're testing each of those individually. This is mostly to check for syntax errors.""" diff --git a/tests/pipelines/test_rocrate.py b/tests/pipelines/test_rocrate.py index 01a77ecd76..ac86e64bdf 100644 --- a/tests/pipelines/test_rocrate.py +++ b/tests/pipelines/test_rocrate.py @@ -1,5 +1,6 @@ """Test the nf-core pipelines rocrate command""" +import json import shutil import tempfile from pathlib import Path @@ -12,6 +13,7 @@ import nf_core.pipelines.create.create import nf_core.pipelines.rocrate import nf_core.utils +from nf_core.pipelines.bump_version import bump_pipeline_version from ..test_pipelines import TestPipelines @@ -125,3 +127,36 @@ def test_rocrate_creation_for_fetchngs(self): # Clean up shutil.rmtree(tmp_dir) + + def test_update_rocrate(self): + """Run the nf-core rocrate command with a zip output""" + + assert self.rocrate_obj.create_rocrate(json_path=self.pipeline_dir, zip_path=self.pipeline_dir) + + # read the crate json file + with open(Path(self.pipeline_dir, "ro-crate-metadata.json")) as f: + crate = json.load(f) + + # check the old version + self.assertEqual(crate["@graph"][2]["version"][0], "1.0.0dev") + # check creativeWorkStatus is InProgress + self.assertEqual(crate["@graph"][0]["creativeWorkStatus"], "InProgress") + + # bump version + bump_pipeline_version(self.pipeline_obj, "1.1.0") + + # Check that the crate was created + self.assertTrue(Path(self.pipeline_dir, "ro-crate.crate.zip").exists()) + + # Check that the crate was updated + self.assertTrue(Path(self.pipeline_dir, "ro-crate-metadata.json").exists()) + + # read the crate json file + with open(Path(self.pipeline_dir, "ro-crate-metadata.json")) as f: + crate = json.load(f) + + # check that the version was updated + self.assertEqual(crate["@graph"][2]["version"][0], "1.1.0") + + # check creativeWorkStatus is Stable + self.assertEqual(crate["@graph"][0]["creativeWorkStatus"], "Stable") diff --git a/tests/pipelines/test_sync.py b/tests/pipelines/test_sync.py index 8bf8a3c4ec..9959975e27 100644 --- a/tests/pipelines/test_sync.py +++ b/tests/pipelines/test_sync.py @@ -43,14 +43,14 @@ def mocked_requests_get(url) -> MockResponse: { "state": "closed", "head": {"ref": "nf-core-template-merge-2"}, - "base": {"ref": "master"}, + "base": {"ref": "main"}, "html_url": "pr_url", } ] + [ { "state": "open", "head": {"ref": f"nf-core-template-merge-{branch_no}"}, - "base": {"ref": "master"}, + "base": {"ref": "main"}, "html_url": "pr_url", } for branch_no in range(3, 7) @@ -345,7 +345,7 @@ def test_close_open_pr(self, mock_patch, mock_post) -> None: pr: Dict[str, Union[str, Dict[str, str]]] = { "state": "open", "head": {"ref": "nf-core-template-merge-3"}, - "base": {"ref": "master"}, + "base": {"ref": "main"}, "html_url": "pr_html_url", "url": "url_to_update_pr", "comments_url": "pr_comments_url", @@ -368,7 +368,7 @@ def test_close_open_pr_fail(self, mock_patch, mock_post): pr = { "state": "open", "head": {"ref": "nf-core-template-merge-3"}, - "base": {"ref": "master"}, + "base": {"ref": "main"}, "html_url": "pr_html_url", "url": "bad_url_to_update_pr", "comments_url": "pr_comments_url", diff --git a/tests/utils.py b/tests/utils.py index cffe8ba103..1aa3750d8e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -14,7 +14,7 @@ import nf_core.modules import nf_core.pipelines.create.create from nf_core import __version__ -from nf_core.utils import NFCoreTemplateConfig, NFCoreYamlConfig +from nf_core.utils import NFCoreTemplateConfig, NFCoreYamlConfig, custom_yaml_dumper TEST_DATA_DIR = Path(__file__).parent / "data" OLD_TRIMGALORE_SHA = "9b7a3bdefeaad5d42324aa7dd50f87bea1b04386" @@ -138,7 +138,7 @@ def create_tmp_pipeline(no_git: bool = False) -> Tuple[Path, Path, str, Path]: bump_version=None, ) with open(str(Path(pipeline_dir, ".nf-core.yml")), "w") as fh: - yaml.dump(nf_core_yml.model_dump(), fh) + yaml.dump(nf_core_yml.model_dump(), fh, Dumper=custom_yaml_dumper()) nf_core.pipelines.create.create.PipelineCreate( pipeline_name, "it is mine", "me", no_git=no_git, outdir=pipeline_dir, force=True