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

fix some errors in github action, and add python 3.12 #286

Merged
merged 6 commits into from
Dec 10, 2023
Merged

fix some errors in github action, and add python 3.12 #286

merged 6 commits into from
Dec 10, 2023

Conversation

graphenn
Copy link
Contributor

@graphenn graphenn commented Dec 8, 2023

Not all issues fixed. The left issue can be test with code below.

from cyvcf2 import VCF, Writer

VCF_PATH ="./cyvcf2/tests/test.vcf.gz"

def test():
    input_vcf = VCF('./cyvcf2/tests/seg.vcf.gz')
    output_vcf = Writer('./test.vcf', input_vcf)
    for v in input_vcf:
        v.genotypes = [[1,1,False]]
        output_vcf.write_record(v)
    output_vcf.close()

def test2():
    vcf = VCF(VCF_PATH)
    for variant in vcf:
        print(variant)
        break

    print("11")
    vcf.close()
    print("22")

test()
test2()

It may be same issue with these, on htslib 1.18

Fixed possible double frees when handling errors in bcf_hdr_add_hrec(), if particular memory allocations fail. (PR samtools/htslib#1637)

Ensure that bcf_hdr_remove() clears up all pointers to the items removed from dictionaries. Failing to do this could have resulted in a call requesting a deleted item via bcf_hdr_get_hrec() returning a stale pointer. (PR samtools/htslib#1637)

I tried but failed to upgrade htslib version.

@graphenn
Copy link
Contributor Author

graphenn commented Dec 8, 2023

Add build test case for the offical python docker image, arm64/amd64 + debian #274

It can pass pytest if remove test_write_missing_contig case in test_reader.py (the left issue). Arm64 + debain build issue also fixed.

@graphenn
Copy link
Contributor Author

graphenn commented Dec 9, 2023

I have found a solution to decouple the compilation of cyvcf2 and htslib, which now enables the upgrade of htslib. Additionally, by statically linking to the htslib library, we can avoid redundant compilations. This approach ensures a smoother and more efficient development process. I have tested htslib 1.18, but the test_write_missing_contig test case still error.

Do you want me to submit this changes here or later?

@graphenn
Copy link
Contributor Author

graphenn commented Dec 9, 2023

everything works now! And I will submit decouple the compilation of cyvcf2 and htslib at another PR later.

@graphenn graphenn requested a review from brentp December 9, 2023 19:22
@brentp brentp merged commit eca1d90 into brentp:main Dec 10, 2023
8 checks passed
@brentp
Copy link
Owner

brentp commented Dec 10, 2023

This is amazing! thanks so much. PR for decoupling would be great!

@brentp
Copy link
Owner

brentp commented Dec 10, 2023

not all heroes wear capes, but, fittingly, your avatar does. 🦸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants