Skip to content

Commit

Permalink
pints 1.1.13 (#6709)
Browse files Browse the repository at this point in the history
* build(pints): Switch to PyPI

The bioconda builds aren't getting updated, and the biocontainers
containers aren't getting updated. They're publishing to PyPI
consistently, so we'll meet them where they're at.
Really need the stuff in
hyulab/PINTS@101c0cb
like yesterday.

* chore: Add renovate comment

* build: Include pybedtools manually

And htslib for bgzip. pybedtools wiht pip needs gcc to install.

* chore: Copy code from @ewels

#6694 (comment)

Co-authored-by: ewels <[email protected]>

* build: Fix uv shebang

* fix(#6694): Remove async code

* style: Run ruff

* fix(#6694): Clean up some errors

And by that I mean comment out the code.
Seriously anyone reading these?

* chore: Clean up httpx

* refactor: Simplify script

* fix: Remove oras

* fix: containerimage => containerImage

* fix: Remove oras and mediatype => mediaType

* style: Run ruff

---------

Co-authored-by: ewels <[email protected]>
  • Loading branch information
edmundmiller and ewels authored Oct 3, 2024
1 parent f351fad commit ac55541
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 13 deletions.
54 changes: 54 additions & 0 deletions .github/scripts/wave_singularity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "httpx",
# ]
# ///

import logging

import httpx

logger = logging.getLogger(__name__)

image_url = "oras://community.wave.seqera.io/library/pybedtools_bedtools_htslib_pip_pypints:aa20de1f1b5ddb30"

if image_url.startswith("oras://"):
image_url = image_url.replace("oras://", "")

wave_api_url = "https://wave.seqera.io"
url = f"{wave_api_url}/v1alpha1/inspect"

# if platform_pat:
# data["toweraccesstoken"] = platform_pat
# else:
# TODO
logger.warning("'platform_pat' not set, no auth to wave back end")

try:
logger.info(f"calling image inspect at {url} for image url {image_url}")
response = httpx.post(
url=url,
json={"containerImage": image_url},
headers={"content-type": "application/json"},
)

data = response.json()
logger.debug(data)
layers = data.get("container", {}).get("manifest", {}).get("layers", [])
is_singularity = len(layers) == 1 and layers[0].get("mediaType", "").endswith(".sif")
if not is_singularity:
print(layers)
raise ValueError("not a singularity image")
if "digest" not in layers[0]:
print(layers)
raise ValueError("no 'digest' in first layer found")

digest = layers[0]["digest"].replace("sha256:", "")
container_url = f"https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/{digest[:2]}/{digest}/data"
print(container_url)

except httpx.RequestError as exc:
print(f"An error occurred while requesting {exc.request.url!r}.")
print("No singularity image for you")
9 changes: 8 additions & 1 deletion modules/nf-core/pints/caller/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::pypints=1.1.10
- pybedtools
- bedtools
- htslib
- pip
- pip: # FIXME https://github.com/nf-core/modules/issues/5814
# NOTE PINTS isn't adding conda builds and is a few versions behind.
# renovate: datasource=pypi depName=pypints
- pypints==1.1.13
4 changes: 2 additions & 2 deletions modules/nf-core/pints/caller/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ process PINTS_CALLER {
conda "${moduleDir}/environment.yml"
// NOTE Stopped publishing at 1.1.9 https://quay.io/repository/biocontainers/pypints?tab=tags
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'oras://community.wave.seqera.io/library/pints_caller:650ef63c9768bb5a' :
'community.wave.seqera.io/library/pints_caller:b1e6404513917871' }"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/f1/f1a9e30012e1b41baf9acd1ff94e01161138d8aa17f4e97aa32f2dc4effafcd1/data' :
'community.wave.seqera.io/library/pybedtools_bedtools_htslib_pip_pypints:39699b96998ec5f6' }"

input:
tuple val(meta), path(bams), path(bais)
Expand Down
5 changes: 3 additions & 2 deletions modules/nf-core/pints/caller/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nextflow_process {
process.out.divergent_TREs,
process.out.bidirectional_TREs,
file(process.out.unidirectional_TREs.get(0).get(1).get(0)).name,
process.out.versions,
path(process.out.versions.get(0)).yaml,
).match("bams")
},
)
Expand Down Expand Up @@ -65,9 +65,10 @@ nextflow_process {
process.out.divergent_TREs,
process.out.bidirectional_TREs,
file(process.out.unidirectional_TREs[0][1]).name,
process.out.versions,
path(process.out.versions.get(0)).yaml,
).match("single_bam")
},
{ assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") },
)
}
}
Expand Down
37 changes: 29 additions & 8 deletions modules/nf-core/pints/caller/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
{
"versions": {
"content": [
{
"PINTS_CALLER": {
"python": "3.12.6",
"pints": "1.1.13"
}
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-29T22:22:29.559913"
},
"bams": {
"content": [
[
Expand All @@ -24,15 +39,18 @@
]
],
"test_1_unidirectional_peaks.bed",
[
"versions.yml:md5,6142633d4306c8a74b9716c4aac7e956"
]
{
"PINTS_CALLER": {
"python": "3.12.6",
"pints": "1.1.13"
}
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T12:17:21.517020581"
"timestamp": "2024-09-29T22:19:23.738834"
},
"single_bam": {
"content": [
Expand All @@ -55,14 +73,17 @@
]
],
"test_1_unidirectional_peaks.bed",
[
"versions.yml:md5,6142633d4306c8a74b9716c4aac7e956"
]
{
"PINTS_CALLER": {
"python": "3.12.6",
"pints": "1.1.13"
}
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T11:07:12.112579276"
"timestamp": "2024-09-29T22:22:29.544608"
}
}

0 comments on commit ac55541

Please sign in to comment.