fedarko / strainFlye

Pipeline for analyzing (rare) mutations in metagenome-assembled genomes
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Build (pysam installation) is breaking? #66

Closed fedarko closed 1 year ago

fedarko commented 1 year ago

Looks like all the tests that import pysam give this sort of error:

2023-05-03T05:25:54.0009511Z __________________ ERROR collecting strainflye/align_utils.py __________________
2023-05-03T05:25:54.0010265Z strainflye/align_utils.py:6: in <module>
2023-05-03T05:25:54.0010613Z     import pysam
2023-05-03T05:25:54.0011191Z /usr/share/miniconda/envs/strainflye/lib/python3.6/site-packages/pysam/__init__.py:5: in <module>
2023-05-03T05:25:54.0011636Z     from pysam.libchtslib import *
2023-05-03T05:25:54.0038126Z ERROR conda.cli.main_run:execute(47): `conda run make test` failed. (See above for error)
2023-05-03T05:25:54.0038623Z E   ImportError: libhts.so.2: cannot open shared object file: No such file or directory

And importing pysamstats also breaks things, but in a different way:

____________ ERROR collecting strainflye/tests/test_matrix_utils.py ____________
strainflye/tests/test_matrix_utils.py:8: in <module>
    import strainflye.matrix_utils as mu
strainflye/matrix_utils.py:8: in <module>
    from strainflye import (
strainflye/call_utils.py:6: in <module>
    import pysamstats
/usr/share/miniconda/envs/strainflye/lib/python3.6/site-packages/pysamstats/__init__.py:8: in <module>
    from .pileup import *
/usr/share/miniconda/envs/strainflye/lib/python3.6/site-packages/pysamstats/pileup.py:6: in <module>
    import pysamstats.opt as opt
E   AttributeError: module 'pysamstats' has no attribute 'opt'

Not sure what's up exactly -- the GitHub Actions logs are being weirdly vague about what versions of pysam/pysamstats were installed (they say ... (more hidden) ... where i would expect to see info about these versions ._.) It looks like GitHub Actions is installing a relatively new version of bcftools (v1.17), and it looks like bcftools has conflicted with pysam before in a way that cause a similar libhts ImportError (https://github.com/pysam-developers/pysam/issues/427) -- maybe try pinning bcftools to < 1.16?

fedarko commented 1 year ago

ok, pinning bcftools didn't work. but from the latest logs, i can see the version of pysam being installed -- looks like it's pysam-0.11.2.2 ???? this is a really old version, so it makes sense that it could be causing these problems. why is it getting installed, tho.

tried upping the lower pysam pin to 0.15; we'll see what happens. (looks like pysam 0.15.2, etc are still on bioconda -- https://anaconda.org/bioconda/pysam/files -- so idk why conda is deciding to install this ancient pysam version.)

fedarko commented 1 year ago

alright, that fixed it??? not gonna look a gift horse in the mouth.