Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

145 quilt sumarize.json wrong path for child html files #148

Merged
merged 5 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected].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 [email protected].1
```

For Tower, you can use the "Pre-run script" to set the environment variables.
Expand Down
4 changes: 2 additions & 2 deletions plugins/nf-quilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ sourceSets {
test.resources.srcDirs = ['src/testResources']
}

ext{
nextflowVersion = '23.04.3'
ext {
nextflowVersion = rootProject.file('VERSION').text.trim()
}

dependencies {
Expand Down
13 changes: 8 additions & 5 deletions plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -141,7 +143,7 @@ ${nextflow}
meta = setupMeta()
String text = setupReadme()
log.debug("setupReadme: $text")
Map quilt_summarize = setupSummarize()
List<Map> quilt_summarize = setupSummarize()
log.debug("setupSummarize: $quilt_summarize")
int rc = pkg.push(msg, meta)
log.info("$rc: pushed package[$pkg] $msg")
Expand Down Expand Up @@ -289,8 +291,8 @@ ${nextflow}
return matches
}

Map setupSummarize() {
Map quilt_summarize = [:]
List<Map> setupSummarize() {
List<Map> quilt_summarize = []
if (shouldSkip(KEY_SUMMARIZE)) {
return quilt_summarize
}
Expand All @@ -300,11 +302,12 @@ ${nextflow}
List<Path> 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
}
Expand Down
12 changes: 0 additions & 12 deletions plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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<Map> quilt_summarize = product.setupSummarize()
expect:
quilt_summarize
quilt_summarize.size() == 1
}

@IgnoreIf({ env.WRITE_BUCKET == 'quilt-example' || env.WRITE_BUCKET == null })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down