For anyone that's still using pkg_resources to pri...
# pipeline-maintainers
e
For anyone that's still using pkg_resources to print python lib versions in this way:
Copy code
biopython: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('biopython').version)")
This produces a warning saying that pkg_resources is deprecated. To fix, use this instead:
Copy code
biopython: \$(python -c "import importlib.metadata; print(importlib.metadata.version('biopython'))")
👍 2
👍🏽 1
j
Copy code
biopython: \$(python3 -c "import Bio; print(Bio.__version__)")
This worked for me and is a bit better readable
👍 1
Btw I built a sequera container for biopython 1.85 (latest) if you need
Copy code
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
        'oras://community.wave.seqera.io/library/biopython:1.85--a6f54362a38870a0' :
        'community.wave.seqera.io/library/biopython:1.85--6f761292fa9881b4' }"
e
Nice, thanks!
p
https not oras if possible please 🙏🏻
➕ 1
j
😮 Totally forgot! Thx!
👍🏻 1
p
Copy code
https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/83/8372f6241b480332d91bc00a88ec8c72c8f7fcc9994177a5dd67a07007cd6e32/data
🙂
For casual readers
🙏 1
o
I thought we could use oras URLs now. It's not possible yet?
p
See thread here for reasoning
Hopefully we'll automate (almost) all containers in the not too distant future, and you won't need to worry about this again
🙏 1
o
Actually at first I used https urls, but I thought I read somewhere that we could now use the oras directly... I must have dreamed ^^ thanks for the explanation :)
p
I mean you can - it'll work for most people most of the time.
But for our use cases / audience, I think
https
is safer and I basically don't see any downsides
👍 1
o
BTW, for printing python versions in a process using channel topics, I'm using it:
Copy code
tuple val("${task.process}"), val('python'),   eval("python3 --version | sed 's/Python //'"),                     topic: versions
tuple val("${task.process}"), val('polars'),   eval('python3 -c "import polars; print(polars.__version__)"'),     topic: versions
and for Rscripts:
Copy code
tuple val("${task.process}"), val('R'),      eval('Rscript -e "cat(R.version.string)" | sed "s/R version //"'),  topic: versions
tuple val("${task.process}"), val('DESeq2'), eval('Rscript -e "cat(as.character(packageVersion(\'DESeq2\')))"'), topic: versions