From 01484e8ecd8a208bc2adc3d0634227169aad3ccb Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" Date: Sun, 15 Oct 2023 10:45:14 -0700 Subject: [PATCH] 145 quilt sumarize.json wrong path for child html files (#148) --- CHANGELOG.md | 5 +++++ README.md | 4 ++-- plugins/nf-quilt/build.gradle | 4 ++-- .../src/main/nextflow/quilt/QuiltProduct.groovy | 13 ++++++++----- .../src/main/nextflow/quilt/jep/QuiltPackage.groovy | 12 ------------ plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF | 2 +- .../src/test/nextflow/quilt/QuiltProductTest.groovy | 8 +++++--- .../src/test/nextflow/quilt/nio/QuiltNioTest.groovy | 5 ++++- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d097b5..fd3dfbff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [0.7.1] 2023-10-15 + +- Fix [quiltdata/nf-quilt#145](https://github.com/quiltdata/nf-quilt/issues/145) +- Remove automatic pre-install of packages + ## [0.7.0] 2023-10-05 - Officially QuiltCore 0.1.0 instead of Python diff --git a/README.md b/README.md index 6c173b02..75619abe 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ From the command-line, do, e.g.: ```bash # export NXF_VER=23.04.3 -export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.0/nf-quilt-0.7.0-meta.json -nextflow run main.nf -plugins nf-quilt@0.7.0 +export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.1/nf-quilt-0.7.1-meta.json +nextflow run main.nf -plugins nf-quilt@0.7.1 ``` For Tower, you can use the "Pre-run script" to set the environment variables. diff --git a/plugins/nf-quilt/build.gradle b/plugins/nf-quilt/build.gradle index c40f1501..1cd4220c 100644 --- a/plugins/nf-quilt/build.gradle +++ b/plugins/nf-quilt/build.gradle @@ -54,8 +54,8 @@ sourceSets { test.resources.srcDirs = ['src/testResources'] } -ext{ - nextflowVersion = '23.04.3' +ext { + nextflowVersion = rootProject.file('VERSION').text.trim() } dependencies { diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index 5bc876ab..ee04edc6 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -98,6 +98,8 @@ ${nextflow} String dir = pkg.packageDest() Path path = Paths.get(dir, filename.split('/') as String[]) try { + // ensure directories exist first + path.getParent().toFile().mkdirs() Files.write(path, text.bytes) } catch (Exception e) { @@ -141,7 +143,7 @@ ${nextflow} meta = setupMeta() String text = setupReadme() log.debug("setupReadme: $text") - Map quilt_summarize = setupSummarize() + List quilt_summarize = setupSummarize() log.debug("setupSummarize: $quilt_summarize") int rc = pkg.push(msg, meta) log.info("$rc: pushed package[$pkg] $msg") @@ -289,8 +291,8 @@ ${nextflow} return matches } - Map setupSummarize() { - Map quilt_summarize = [:] + List setupSummarize() { + List quilt_summarize = [] if (shouldSkip(KEY_SUMMARIZE)) { return quilt_summarize } @@ -300,11 +302,12 @@ ${nextflow} List paths = match(wildcard) paths.each { path -> String filename = path.getFileName() - quilt_summarize[filename] = path + Map entry = ["path": path.toString(), "title": filename] + quilt_summarize.add(entry) } } - String qs_json = JsonOutput.toJson(quilt_summarize.keySet() as String[]) + String qs_json = JsonOutput.toJson(quilt_summarize) writeString(qs_json, pkg, SUMMARY_FILE) return quilt_summarize } diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index 57daef2a..7d0129aa 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -87,18 +87,6 @@ class QuiltPackage { pkg = new QuiltPackage(parsed) PKGS[pkgKey] = pkg - if (pkg.is_force()) { - //log.debug("Do not install `${pkg}` if force-overwriting output") - return pkg - } - - try { - log.debug("${pkg}: attempting install for.pkgKey $pkgKey (okay if fails)") - pkg.install() - } - catch (IOException e) { - log.warn("Package `${parsed.toUriString()}` does not yet exist") - } return pkg } diff --git a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF b/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF index ea14aa6c..d54d2ff9 100644 --- a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF +++ b/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Plugin-Class: nextflow.quilt.QuiltPlugin Plugin-Id: nf-quilt -Plugin-Version: 0.7.0 +Plugin-Version: 0.7.1 Plugin-Provider: Quilt Data Plugin-Requires: >=22.10.6 diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy index 2eb0e0ab..d3e94904 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy @@ -115,16 +115,18 @@ class QuiltProductTest extends QuiltSpecification { product.pkg.reset() expect: !product.match('*.md') - product.setupSummarize() == [:] + product.setupSummarize() == [] } void 'should create summarize if files are present'() { String readme_text = 'hasREADME' QuiltProduct product = makeProduct("readme=${readme_text}") product.setupReadme() - expect: product.match('*.md') - product.setupSummarize() + List quilt_summarize = product.setupSummarize() + expect: + quilt_summarize + quilt_summarize.size() == 1 } @IgnoreIf({ env.WRITE_BUCKET == 'quilt-example' || env.WRITE_BUCKET == null }) diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy index 4bffd441..3cdc1861 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy @@ -68,7 +68,10 @@ class QuiltNioTest extends QuiltSpecification { @IgnoreIf({ System.getProperty('os.name').contains('indows') }) void 'should read from a path'() { given: - Path path = Paths.get(new URI(READ_URL)) + QuiltPath path = Paths.get(new URI(READ_URL)) as QuiltPath + path.pkg().install() + + when: when: String text = readObject(path)